MCPcopy Create free account
hub / github.com/apache/singa / shape

Function shape

python/singa/autograd.py:3386–3395  ·  view source on GitHub ↗

Takes a tensor as input and outputs a tensor containing the shape of the input tensor. Args: x (Tensor): Input tensor Returns: Tensor, the output

(x)

Source from the content-addressed store, hash-verified

3384
3385
3386def shape(x):
3387 """
3388 Takes a tensor as input and outputs a tensor containing the shape of the
3389 input tensor.
3390 Args:
3391 x (Tensor): Input tensor
3392 Returns:
3393 Tensor, the output
3394 """
3395 return Shape()(x)[0]
3396
3397
3398# optimize max to support multi inputs

Callers 1

FromProtoMethod · 0.85

Calls 1

ShapeClass · 0.85

Tested by

no test coverage detected