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

Function shape

tensorflow/python/ops/array_ops.py:425–447  ·  view source on GitHub ↗

Returns the shape of a tensor. This operation returns a 1-D integer tensor representing the shape of `input`. For example: ```python t = tf.constant([[[1, 1, 1], [2, 2, 2]], [[3, 3, 3], [4, 4, 4]]]) tf.shape(t) # [2, 2, 3] ``` Args: input: A `Tensor` or `SparseTensor`. nam

(input, name=None, out_type=dtypes.int32)

Source from the content-addressed store, hash-verified

423
424@tf_export(v1=["shape"])
425def shape(input, name=None, out_type=dtypes.int32):
426 # pylint: disable=redefined-builtin
427 """Returns the shape of a tensor.
428
429 This operation returns a 1-D integer tensor representing the shape of `input`.
430
431 For example:
432
433 ```python
434 t = tf.constant([[[1, 1, 1], [2, 2, 2]], [[3, 3, 3], [4, 4, 4]]])
435 tf.shape(t) # [2, 2, 3]
436 ```
437
438 Args:
439 input: A `Tensor` or `SparseTensor`.
440 name: A name for the operation (optional).
441 out_type: (Optional) The specified output type of the operation (`int32` or
442 `int64`). Defaults to `tf.int32`.
443
444 Returns:
445 A `Tensor` of type `out_type`.
446 """
447 return shape_internal(input, name, optimize=True, out_type=out_type)
448
449
450def shape_internal(input, name=None, optimize=True, out_type=dtypes.int32):

Callers 6

shape_v2Function · 0.70
boolean_maskFunction · 0.70
_batch_gatherFunction · 0.70
batch_gather_ndFunction · 0.70
repeat_with_axisFunction · 0.70
_with_nonzero_rankFunction · 0.70

Calls 1

shape_internalFunction · 0.85

Tested by

no test coverage detected