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

Function shape_from_pyval

tensorflow/compiler/xla/python/xla_client.py:432–441  ·  view source on GitHub ↗

Returns a Shape that describes a tuple-tree of Numpy arrays.

(pyval)

Source from the content-addressed store, hash-verified

430
431
432def shape_from_pyval(pyval):
433 """Returns a Shape that describes a tuple-tree of Numpy arrays."""
434
435 def convert(pyval):
436 if isinstance(pyval, tuple):
437 return Shape.tuple_shape(tuple(convert(elt) for elt in pyval))
438 else:
439 return Shape.array_shape(pyval.dtype, np.shape(pyval))
440
441 return convert(pyval)
442
443
444def transfer_to_infeed(value, device=None):

Callers 1

ParameterFromNumpyMethod · 0.85

Calls 1

convertFunction · 0.70

Tested by

no test coverage detected