Skip to content

Commit

Permalink
ports fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Ruberry committed Feb 12, 2021
1 parent c307a3f commit e356aa3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
10 changes: 5 additions & 5 deletions tools/pyi/gen_pyi.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,8 @@ def gen_pyi(native_yaml_path: str, deprecated_yaml_path: str, fm: FileManager) -
'saddmm': ['def saddmm(input: Tensor, mat1: Tensor, mat2: Tensor, *, beta: Number=1, '
'alpha: Number=1, out: Optional[Tensor]=None) -> Tensor: ...'],
'spmm': ['def spmm(input: Tensor, mat2: Tensor) -> Tensor: ...'],
'div': ['def div(input: Union[Tensor, Number], other: Union[Tensor, Number], '
'rounding_mode: str = "true", *, out: Optional[Tensor]=None) -> Tensor: ...'],
'div': ['def div(input: Union[Tensor, Number], other: Union[Tensor, Number], *, '
'rounding_mode: Optional[str]=None, out: Optional[Tensor]=None) -> Tensor: ...'],
})
for binop in ['mul', 'true_divide', 'floor_divide']:
unsorted_function_hints[binop].append(
Expand Down Expand Up @@ -462,9 +462,9 @@ def gen_pyi(native_yaml_path: str, deprecated_yaml_path: str, fm: FileManager) -
'def set_(self, storage: Storage) -> Tensor: ...'],
'split': ['def split(self, split_size: _int, dim: _int=0) -> Sequence[Tensor]: ...',
'def split(self, split_size: Tuple[_int, ...], dim: _int=0) -> Sequence[Tensor]: ...'],
'div': ['def div(self, other: Union[Tensor, Number], '
'rounding_mode: str = "true", *, out: Optional[Tensor]=None) -> Tensor: ...'],
'div_': ['def div_(self, other: Union[Tensor, Number], rounding_mode: str = "true") -> Tensor: ...'],
'div': ['def div(self, other: Union[Tensor, Number], *, '
'rounding_mode: Optional[str]=None, out: Optional[Tensor]=None) -> Tensor: ...'],
'div_': ['def div_(self, other: Union[Tensor, Number], *, rounding_mode: Optional[str]=None) -> Tensor: ...'],
})
for binop in ['mul', 'true_divide', 'floor_divide']:
for inplace in [False, True]:
Expand Down
8 changes: 4 additions & 4 deletions torch/_tensor_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1194,25 +1194,25 @@ def add_docstr_all(method, docstr):
""")

add_docstr_all('div', r"""
div(value, *, rounding_mode='true') -> Tensor
div(value, *, rounding_mode=None) -> Tensor
See :func:`torch.div`
""")

add_docstr_all('div_', r"""
div_(value, *, rounding_mode='true') -> Tensor
div_(value, *, rounding_mode=None) -> Tensor
In-place version of :meth:`~Tensor.div`
""")

add_docstr_all('divide', r"""
divide(value, *, rounding_mode='true') -> Tensor
divide(value, *, rounding_mode=None) -> Tensor
See :func:`torch.divide`
""")

add_docstr_all('divide_', r"""
divide_(value, *, rounding_mode='true') -> Tensor
divide_(value, *, rounding_mode=None) -> Tensor
In-place version of :meth:`~Tensor.divide`
""")
Expand Down
8 changes: 4 additions & 4 deletions torch/_torch_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2741,7 +2741,7 @@ def merge_dicts(*dicts):
""".format(**common_args))

add_docstr(torch.div, r"""
div(input, other, *, rounding_mode='true' out=None) -> Tensor
div(input, other, *, rounding_mode=None, out=None) -> Tensor
Divides each element of the input ``input`` by the corresponding element of
:attr:`other`.
Expand All @@ -2764,7 +2764,7 @@ def merge_dicts(*dicts):
Keyword args:
rounding_mode (str, optional): Type of rounding applied to the result:
* ``"true"`` - default behavior. Performs no rounding and, if both :attr:`input` and
* None - default behavior. Performs no rounding and, if both :attr:`input` and
:attr:`other` are integer types, promotes the inputs to the default scalar type.
Equivalent to true division in Python (the ``/`` operator) and NumPy's ``np.true_divide``.
* ``"trunc"`` - rounds the results of the division towards zero.
Expand Down Expand Up @@ -2806,7 +2806,7 @@ def merge_dicts(*dicts):
""".format(**common_args))

add_docstr(torch.divide, r"""
divide(input, other, *, rounding_mode='true', out=None) -> Tensor
divide(input, other, *, rounding_mode=None, out=None) -> Tensor
Alias for :func:`torch.div`.
""")
Expand Down Expand Up @@ -9207,7 +9207,7 @@ def merge_dicts(*dicts):
add_docstr(torch.true_divide, r"""
true_divide(dividend, divisor, *, out) -> Tensor
Alias for :func:`torch.div` with ``rounding_mode='true'``.
Alias for :func:`torch.div` with ``rounding_mode=None``.
""".format(**common_args))

add_docstr(torch.trunc,
Expand Down

0 comments on commit e356aa3

Please sign in to comment.