MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / make_placeholder_from_tensor

Function make_placeholder_from_tensor

tensorflow/contrib/graph_editor/util.py:451–471  ·  view source on GitHub ↗

Create a `tf.compat.v1.placeholder` for the Graph Editor. Note that the correct graph scope must be set by the calling function. Args: t: a `tf.Tensor` whose name will be used to create the placeholder (see function placeholder_name). scope: absolute scope within which to create

(t, scope=None,
                                 prefix=_DEFAULT_PLACEHOLDER_PREFIX)

Source from the content-addressed store, hash-verified

449
450
451def make_placeholder_from_tensor(t, scope=None,
452 prefix=_DEFAULT_PLACEHOLDER_PREFIX):
453 """Create a `tf.compat.v1.placeholder` for the Graph Editor.
454
455 Note that the correct graph scope must be set by the calling function.
456
457 Args:
458 t: a `tf.Tensor` whose name will be used to create the placeholder (see
459 function placeholder_name).
460 scope: absolute scope within which to create the placeholder. None means
461 that the scope of `t` is preserved. `""` means the root scope.
462 prefix: placeholder name prefix.
463
464 Returns:
465 A newly created `tf.compat.v1.placeholder`.
466 Raises:
467 TypeError: if `t` is not `None` or a `tf.Tensor`.
468 """
469 return tf_array_ops.placeholder(
470 dtype=t.dtype, shape=t.get_shape(),
471 name=placeholder_name(t, scope=scope, prefix=prefix))
472
473
474def make_placeholder_from_dtype_and_shape(dtype, shape=None, scope=None,

Callers

nothing calls this directly

Calls 3

placeholder_nameFunction · 0.85
placeholderMethod · 0.45
get_shapeMethod · 0.45

Tested by

no test coverage detected