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

Function variable_shape

tensorflow/python/ops/resource_variable_ops.py:1865–1872  ·  view source on GitHub ↗
(handle, out_type=dtypes.int32)

Source from the content-addressed store, hash-verified

1863
1864
1865def variable_shape(handle, out_type=dtypes.int32):
1866 if getattr(
1867 handle, "_handle_data", None) is None or not handle._handle_data.is_set: # pylint: disable=protected-access
1868 return gen_resource_variable_ops.variable_shape(handle, out_type=out_type)
1869 shape_proto = handle._handle_data.shape_and_type[0].shape # pylint: disable=protected-access
1870 if shape_proto.unknown_rank or any(x.size == -1 for x in shape_proto.dim):
1871 return gen_resource_variable_ops.variable_shape(handle, out_type=out_type)
1872 return constant_op.constant([x.size for x in shape_proto.dim], dtype=out_type)
1873
1874
1875@ops.RegisterGradient("ResourceGather")

Callers 1

_GatherGradFunction · 0.85

Calls 3

anyFunction · 0.85
variable_shapeMethod · 0.45
constantMethod · 0.45

Tested by

no test coverage detected