def build_graph(self, dtype, shape=None, name=None):
"""Assemble one placeholder.
Args:
shape: The shape of the tensor to be fed (optional). If the shape is not
specified, you can feed a tensor of any shape.
dtype: The type of elements in the placeholder to be fed.
name: A name for the placeholder (optional).
Returns:
placeholder of given shape and data type
"""
ph = tf.placeholder(self.DTYPE[dtype], shape=shape, name=name)
if dtype not in [np.int32, np.int64]:
self.checked = tf.check_numerics(ph, '')
return ph
评论列表
文章目录