Remove **kwargs from torch.meshgrid (#34356)

Summary:
Changelog:
- Remove **kwargs from torch.meshgrid as they serve no purpose

Closes https://github.com/pytorch/pytorch/issues/34206
Pull Request resolved: https://github.com/pytorch/pytorch/pull/34356

Differential Revision: D20310971

Pulled By: zou3519

fbshipit-source-id: 97250051504aa3ec1e2a9af9296e7cc71872e5bf
This commit is contained in:
vishwakftw 2020-03-09 11:59:18 -07:00 committed by Facebook Github Bot
parent 70fe508c26
commit e025677e3c

View File

@ -290,7 +290,7 @@ Examples::
return _VF.einsum(equation, operands)
def meshgrid(*tensors, **kwargs):
def meshgrid(*tensors):
r"""Take :math:`N` tensors, each of which can be either scalar or 1-dimensional
vector, and create :math:`N` N-dimensional grids, where the :math:`i` :sup:`th` grid is defined by
expanding the :math:`i` :sup:`th` input over dimensions defined by other inputs.
@ -321,9 +321,7 @@ expanding the :math:`i` :sup:`th` input over dimensions defined by other inputs.
"""
if not torch.jit.is_scripting():
if any(type(t) is not Tensor for t in tensors) and has_torch_function(tensors):
return handle_torch_function(meshgrid, tensors, *tensors, **kwargs)
if kwargs:
raise TypeError("meshgrid() got an unexpected keyword argument '%s'" % (list(kwargs)[0],))
return handle_torch_function(meshgrid, tensors, *tensors)
if len(tensors) == 1 and isinstance(tensors[0], (list, tuple)):
# the old interface of passing the operands as one list argument
tensors = tensors[0]