masahi commented on code in PR #11896:
URL: https://github.com/apache/tvm/pull/11896#discussion_r907725027
##########
python/tvm/relay/frontend/pytorch.py:
##########
@@ -701,6 +701,41 @@ def ones_like(self, inputs, input_types):
return out
+ def new_ones(self, inputs, input_types):
+ """
+ Returns a Tensor of size size filled with 1. By default, the
+ returned Tensor has the same torch.dtype and torch.device
+ as this tensor.
+
+ Parameters
+ size (int...)
+ a list, tuple, or torch.Size of integers defining the shape of
+ the output tensor.
+ dtype (torch.dtype, optional)
+ the desired type of returned tensor.
+ Default: if None, same torch.dtype as this tensor.
+ device (torch.device, optional)
+ the desired device of returned tensor.
+ Default: if None, same torch.device as this tensor.
+ requires_grad (bool, optional)
+ If autograd should record operations on the returned tensor.
+ Default: False.
Review Comment:
Remove this doc
##########
python/tvm/relay/frontend/pytorch.py:
##########
@@ -765,6 +800,49 @@ def full_like(self, inputs, input_types):
return out
+ def new_full(self, inputs, input_types):
+ """
+ Returns a Tensor of size size filled with fill_value.
+ By default, the returned Tensor has the same dtype
+ and device as this tensor.
+
+ Parameters
+ ----------
+ fill_value (scalar)
+ The number to fill the output tensor with.
+ dtype (torch.dtype, optional)
+ The desired type of returned tensor.
+ Default: if None, same torch.dtype as this tensor.
+ device (torch.device, optional)
+ The desired device of returned tensor.
+ Default: if None, same torch.device as this tensor.
+ requires_grad (bool, optional)
+ If autograd should record operations on the returned
+ tensor. Default: False.
+ """
Review Comment:
Remove this doc
##########
python/tvm/relay/frontend/pytorch.py:
##########
@@ -2336,6 +2419,15 @@ def empty(self, inputs, input_types):
shape = inputs[0]
return _op.zeros(shape, _convert_dtype_value(inputs[1]))
+ def empty_like(self, inputs, input_types):
+ """
+ Returns an uninitialized tensor with the same size as input.
+ torch.empty_like(input) is equivalent to torch.empty(input.size(),
+ dtype=input.dtype, layout=input.layout, device=input.device).
+ """
Review Comment:
Remove this doc
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]