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)
| 3384 | |
| 3385 | |
| 3386 | def 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 |