From 76a53938983894f200b8cf6f7811598d6eb12737 Mon Sep 17 00:00:00 2001 From: SsnL Date: Thu, 30 Nov 2017 14:40:47 -0500 Subject: [PATCH] update Tensor.new doc --- torch/tensor.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/torch/tensor.py b/torch/tensor.py index 79a3958dddf03..ef51144690000 100644 --- a/torch/tensor.py +++ b/torch/tensor.py @@ -14,7 +14,15 @@ class _TensorBase(object): # CUDA case, which handles constructing the tensor on the same GPU # as this tensor. def new(self, *args, **kwargs): - """Constructs a new tensor of the same data type.""" + """Constructs a new tensor of the same data type. + + Any valid argument combination to the Tensor constructor is accepted by + this method, including sizes, :class:`torch.Storage`, numpy ndarray, + Python Sequence, etc. See :class:`torch.Tensor` for more details. + + .. note:: For CUDA tensors, this method will create new tensor on the + same device as this tensor. + """ return self.__class__(*args, **kwargs) def type_as(self, tensor):