tensor

dragon.vm.torch.tensor(
  data,
  dtype=None,
  device=None,
  requires_grad=False
)[source]

Create a tensor initializing from the given data.

Parameters:
  • data (array_like) The data to initialize from.
  • dtype (str, optional) The optional data type.
  • device (dragon.vm.torch.device, optional) The optional device of returned tensor.
  • requires_grad (bool, optional, default=False) True to record gradient for returned tensor.
Returns:

dragon.vm.torch.Tensor The output tensor.