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

Function _eager_reshape

tensorflow/python/framework/constant_op.py:37–46  ·  view source on GitHub ↗

Eager-only version of Reshape op; requires tensor is an eager Tensor.

(tensor, shape, ctx)

Source from the content-addressed store, hash-verified

35
36
37def _eager_reshape(tensor, shape, ctx):
38 """Eager-only version of Reshape op; requires tensor is an eager Tensor."""
39 attr_t = tensor._datatype_enum() # pylint: disable=protected-access
40 attr_tshape, (shape,) = execute.args_to_matching_eager(
41 [shape], ctx, dtypes.int32)
42 inputs_flat = [tensor, shape]
43 attrs = ("T", attr_t, "Tshape", attr_tshape)
44 result, = execute.execute(
45 b"Reshape", 1, inputs=inputs_flat, attrs=attrs, ctx=ctx)
46 return result
47
48
49def _eager_fill(dims, value, ctx):

Callers 1

_constant_implFunction · 0.85

Calls 2

_datatype_enumMethod · 0.80
executeMethod · 0.45

Tested by

no test coverage detected