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:
Returns:

dragon.vm.torch.Tensor – The output tensor.