full

dragon.vm.torch.full(
  size,
  fill_value,
  out=None,
  dtype='int64',
  device=None,
  requires_grad=False
)[source]

Return a tensor filled with a scalar.

Examples:

print(torch.full((1, 2), 1))  # [[1, 1]]
Parameters:
  • size (int...) – The output shape.
  • fill_value (number) – The scalar to fill.
  • out (dragon.vm.torch.Tensor, optional) – The output tensor.
  • dtype (str, optional, default='int64') – 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.