@@ -478,6 +478,16 @@ def where(condition: array, x1: array, x2: array, /) -> array:
478478 x1 , x2 = _fix_promotion (x1 , x2 )
479479 return torch .where (condition , x1 , x2 )
480480
481+ # torch.reshape doesn't have the copy keyword
482+ def reshape (x : array ,
483+ / ,
484+ shape : Tuple [int , ...],
485+ copy : Optional [bool ] = None ,
486+ ** kwargs ) -> array :
487+ if copy is not None :
488+ raise NotImplementedError ("torch.reshape doesn't yet support the copy keyword" )
489+ return torch .reshape (x , shape , ** kwargs )
490+
481491# torch.arange doesn't support returning empty arrays
482492# (https://github.com/pytorch/pytorch/issues/70915), and doesn't support some
483493# keyword argument combinations
@@ -680,8 +690,8 @@ def take(x: array, indices: array, /, *, axis: int, **kwargs) -> array:
680690 'floor_divide' , 'greater' , 'greater_equal' , 'less' , 'less_equal' ,
681691 'logaddexp' , 'multiply' , 'not_equal' , 'pow' , 'remainder' ,
682692 'subtract' , 'max' , 'min' , 'sort' , 'prod' , 'sum' , 'any' , 'all' ,
683- 'mean' , 'std' , 'var' , 'concat' , 'squeeze' , 'broadcast_to' , 'flip' ,
684- 'roll ' , 'nonzero ' , 'where ' , 'arange' , 'eye' , 'linspace' , 'full' ,
693+ 'mean' , 'std' , 'var' , 'concat' , 'squeeze' , 'broadcast_to' , '' flip ', ' roll ',
694+ 'nonzero ' , 'where ' , 'reshape ' , 'arange' , 'eye' , 'linspace' , 'full' ,
685695 'ones' , 'zeros' , 'empty' , 'tril' , 'triu' , 'expand_dims' , 'astype' ,
686696 'broadcast_arrays' , 'unique_all' , 'unique_counts' ,
687697 'unique_inverse' , 'unique_values' , 'matmul' , 'matrix_transpose' ,
0 commit comments