zeros_like

dragon.vm.torch.zeros_like(
  input,
  dtype='float32',
  device=None,
  requires_grad=False
)[source]

Return a tensor of zeros with shape as the other.

\[\text{out} \leftarrow 0 \]
Parameters:
  • input (dragon.vm.torch.Tensor) – The tensor for indicating shape.
  • dtype (str, optional, default='float32') – The data type of output tensor.
  • device (dragon.vm.torch.device, optional) – The device of output tensor.
  • requires_grad (bool, optional, default=False) – Record gradient for output tensor or not.
Returns:

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