@@ -83,7 +83,7 @@ def _broadcast_shapes(*args):
83
83
return _broadcast_shape_impl (array_shapes )
84
84
85
85
86
- def permute_dims (X , axes ):
86
+ def permute_dims (X , / , axes ):
87
87
"""permute_dims(x, axes)
88
88
89
89
Permute the axes (dimensions) of an array; returns the permuted
@@ -120,7 +120,7 @@ def permute_dims(X, axes):
120
120
)
121
121
122
122
123
- def expand_dims (X , axis ):
123
+ def expand_dims (X , / , * , axis = 0 ):
124
124
"""expand_dims(x, axis)
125
125
126
126
Expands the shape of an array by inserting a new axis (dimension)
@@ -166,7 +166,7 @@ def expand_dims(X, axis):
166
166
return dpt .reshape (X , shape )
167
167
168
168
169
- def squeeze (X , axis = None ):
169
+ def squeeze (X , / , axis = None ):
170
170
"""squeeze(x, axis)
171
171
172
172
Removes singleton dimensions (axes) from array `x`.
@@ -211,7 +211,7 @@ def squeeze(X, axis=None):
211
211
return dpt .reshape (X , new_shape )
212
212
213
213
214
- def broadcast_to (X , shape ):
214
+ def broadcast_to (X , / , shape ):
215
215
"""broadcast_to(x, shape)
216
216
217
217
Broadcast an array to a new `shape`; returns the broadcasted
@@ -277,7 +277,7 @@ def broadcast_arrays(*args):
277
277
return [broadcast_to (X , shape ) for X in args ]
278
278
279
279
280
- def flip (X , axis = None ):
280
+ def flip (X , / , * , axis = None ):
281
281
"""flip(x, axis)
282
282
283
283
Reverses the order of elements in an array `x` along the given `axis`.
@@ -309,7 +309,7 @@ def flip(X, axis=None):
309
309
return X [indexer ]
310
310
311
311
312
- def roll (X , shift , axis = None ):
312
+ def roll (X , / , shift , * , axis = None ):
313
313
"""
314
314
roll(x, shift, axis)
315
315
@@ -467,7 +467,7 @@ def _concat_axis_None(arrays):
467
467
return res
468
468
469
469
470
- def concat (arrays , axis = 0 ):
470
+ def concat (arrays , / , * , axis = 0 ):
471
471
"""concat(arrays, axis)
472
472
473
473
Joins a sequence of arrays along an existing axis.
@@ -535,7 +535,7 @@ def concat(arrays, axis=0):
535
535
return res
536
536
537
537
538
- def stack (arrays , axis = 0 ):
538
+ def stack (arrays , / , * , axis = 0 ):
539
539
"""
540
540
stack(arrays, axis)
541
541
@@ -596,7 +596,7 @@ def stack(arrays, axis=0):
596
596
return res
597
597
598
598
599
- def unstack (X , axis = 0 ):
599
+ def unstack (X , / , * , axis = 0 ):
600
600
"""unstack(x, axis=0)
601
601
602
602
Splits an array in a sequence of arrays along the given axis.
@@ -625,7 +625,7 @@ def unstack(X, axis=0):
625
625
return tuple (Y [i ] for i in range (Y .shape [0 ]))
626
626
627
627
628
- def moveaxis (X , source , destination ):
628
+ def moveaxis (X , source , destination , / ):
629
629
"""moveaxis(x, source, destination)
630
630
631
631
Moves axes of an array to new positions.
@@ -714,7 +714,7 @@ def swapaxes(X, axis1, axis2):
714
714
return dpt .permute_dims (X , tuple (ind ))
715
715
716
716
717
- def repeat (x , repeats , axis = None ):
717
+ def repeat (x , repeats , / , * , axis = None ):
718
718
"""repeat(x, repeats, axis=None)
719
719
720
720
Repeat elements of an array.
@@ -930,7 +930,7 @@ def repeat(x, repeats, axis=None):
930
930
return res
931
931
932
932
933
- def tile (x , repetitions ):
933
+ def tile (x , repetitions , / ):
934
934
"""tile(x, repetitions)
935
935
936
936
Repeat an input array `x` along each axis a number of times given by
0 commit comments