tensor

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

Create a tensor initializing the content from data.

Parameters:
  • data (array_like) – The data to initialize.
  • 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.