Skip to content

Commit 2cdaf27

Browse files
committed
Add newaxis to torch aliases
Closes gh-64
1 parent e27958b commit 2cdaf27

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: array_api_compat/torch/_aliases.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ def can_cast(from_: Union[Dtype, array], to: Dtype, /) -> bool:
144144

145145
# Basic renames
146146
bitwise_invert = torch.bitwise_not
147+
newaxis = None
147148

148149
# Two-arg elementwise functions
149150
# These require a wrapper to do the correct type promotion on 0-D tensors
@@ -694,7 +695,7 @@ def take(x: array, indices: array, /, *, axis: Optional[int] = None, **kwargs) -
694695
'atan2', 'bitwise_and', 'bitwise_left_shift', 'bitwise_or',
695696
'bitwise_right_shift', 'bitwise_xor', 'divide', 'equal',
696697
'floor_divide', 'greater', 'greater_equal', 'less', 'less_equal',
697-
'logaddexp', 'multiply', 'not_equal', 'pow', 'remainder',
698+
'logaddexp', 'multiply', 'newaxis', 'not_equal', 'pow', 'remainder',
698699
'subtract', 'max', 'min', 'sort', 'prod', 'sum', 'any', 'all',
699700
'mean', 'std', 'var', 'concat', 'squeeze', 'broadcast_to', 'flip', 'roll',
700701
'nonzero', 'where', 'reshape', 'arange', 'eye', 'linspace', 'full',

0 commit comments

Comments
 (0)