square¶
dragon.vm.torch.
square
(
input,
out=None
)[source]¶Compute the square of input.
\[\text{out} = \text{input}^{2} \]Examples:
x = torch.tensor([2., 3., 4.]) print(torch.square(x)) # [4., 9., 16.]
- Parameters:
- input (dragon.vm.torch.Tensor) – The input tensor.
- out (dragon.vm.torch.Tensor, optional) – The output tensor.
- Returns:
dragon.vm.torch.Tensor – The output tensor.