

device ("torch.device", optional) -- the device of the
        returned tensor. Default: "None", which causes the device of
        "obj" to be used.

requires_grad (bool, optional) -- whether the
    returned tensor requires grad. Default: "False", which causes
    the returned tensor not to require a gradient. If "True", then
    the returned tensor will require a gradient, and if "obj" is
    also a tensor with an autograd history then the returned
    tensor will have the same history.



Example:
  >>> a = torch.tensor([1, 2, 3])
  >>> # Shares memory with tensor 'a'
  >>> b = torch.asarray(a)
  >>> a.data_ptr() == b.data_ptr()
  True
  >>> # Forces memory copy
  >>> c = torch.asarray(a, copy=True)
  >>> a.data_ptr() == c.data_ptr()
  False

  >>> a = torch.tensor([1, 2, 3], requires_grad=True).float()
  >>> b = a + 2
  >>> b
  tensor([1., 2., 3.], grad_fn=<AddBackward0>)
