r"""Removes dimension of shape 1. Args: inp: input tensor. axis: place of axis to be removed. Returns: output tensor. Examples: >>> import numpy as np >>> x = Tensor(np.array([1, 2], dtype=np.int32).reshape(1, 1, 2, 1)) >>> out = F.squee
(inp: Tensor, axis: Optional[Union[int, Sequence[int]]] = None)
| 1068 | |
| 1069 | |
| 1070 | def squeeze(inp: Tensor, axis: Optional[Union[int, Sequence[int]]] = None) -> Tensor: |
| 1071 | r"""Removes dimension of shape 1. |
| 1072 | |
| 1073 | Args: |
| 1074 | inp: input tensor. |
| 1075 | axis: place of axis to be removed. |
| 1076 | |
| 1077 | Returns: |
| 1078 | output tensor. |
| 1079 | |
| 1080 | Examples: |
| 1081 | >>> import numpy as np |
| 1082 | >>> x = Tensor(np.array([1, 2], dtype=np.int32).reshape(1, 1, 2, 1)) |
| 1083 | >>> out = F.squeeze(x, 3) |
| 1084 | >>> out.numpy().shape |
| 1085 | (1, 1, 2) |
| 1086 | """ |
| 1087 | return squeeze_cpp(inp, axis) |
| 1088 | |
| 1089 | |
| 1090 | def repeat(inp: Tensor, repeats: int, axis: Optional[int] = None): |
no outgoing calls
no test coverage detected