task.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:cloudml-samples 作者: GoogleCloudPlatform 项目源码 文件源码
def get_placeholder_input_fn(metadata):
  """Wrap the get input features function to provide the metadata."""

  def get_input_features():
    """Read the input features from the given placeholder."""
    examples = tf.placeholder(
        dtype=tf.string,
        shape=(None,),
        name='input_example')
    features = ml.features.FeatureMetadata.parse_features(metadata, examples,
                                                          keep_target=False)
    features[EXAMPLES_PLACEHOLDER_KEY] = examples
    # The target feature column is not used for prediction so return None.
    return features, None

  # Return a function to input the feaures into the model from a placeholder.
  return get_input_features
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号