mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 12:21:27 +01:00
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:
parent
70fe508c26
commit
e025677e3c
|
|
@ -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]
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user