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

Function make_shape

tensorflow/python/eager/execute.py:196–215  ·  view source on GitHub ↗

Convert v into a list.

(v, arg_name)

Source from the content-addressed store, hash-verified

194
195
196def make_shape(v, arg_name):
197 """Convert v into a list."""
198 # Args:
199 # v: A TensorShapeProto, a list of ints, or a tensor_shape.TensorShape.
200 # arg_name: String, for error messages.
201
202 # Returns:
203 # None if the rank is unknown, otherwise a list of ints (or Nones in the
204 # position where the dimension is unknown).
205 try:
206 shape = tensor_shape.as_shape(v)
207 except TypeError as e:
208 raise TypeError("Error converting %s to a TensorShape: %s." % (arg_name, e))
209 except ValueError as e:
210 raise ValueError("Error converting %s to a TensorShape: %s." % (arg_name,
211 e))
212 if shape.ndims is None:
213 return None
214 else:
215 return shape.as_list()
216
217
218def make_tensor(v, arg_name):

Callers 4

TEST_FFunction · 0.85
TestMergeHandlesMethod · 0.85
TestRelaxHandlesMethod · 0.85
TEST_FFunction · 0.85

Calls 1

as_listMethod · 0.45

Tested by 4

TEST_FFunction · 0.68
TestMergeHandlesMethod · 0.68
TestRelaxHandlesMethod · 0.68
TEST_FFunction · 0.68