Skip to content

Commit e4dd815

Browse files
hawkinsptensorflower-gardener
authored andcommitted
[numpy] Replace np.reshape(x, newshape=y) with np.reshape(x, y).
The `newshape` argument to reshape is removed in NumPy 2.4. PiperOrigin-RevId: 840710218
1 parent a2ae355 commit e4dd815

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

tensorflow_probability/python/bijectors/pad.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def __init__(self,
140140
self._constant_values = tensor_util.convert_nonref_to_tensor(
141141
constant_values, dtype_hint=tf.float32, name='constant_values')
142142
min_event_ndims_ = int(-np.min(np.pad(
143-
np.reshape(axis_, newshape=[-1]),
143+
np.reshape(axis_, [-1]),
144144
mode='constant', pad_width=[[0, 1]])))
145145
super(Pad, self).__init__(
146146
forward_min_event_ndims=min_event_ndims_,

tensorflow_probability/python/internal/empirical_statistical_testing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ def _bootstrap_means(samples, mean_size, fuel):
217217
if num_bootstraps * mean_size <= len(samples):
218218
# Inputs are huge relative to fuel; fake a bootstrap by just slicing
219219
# the input array
220-
return np.mean(np.reshape(samples, newshape=(-1, mean_size)), axis=-1)
220+
return np.mean(np.reshape(samples, (-1, mean_size)), axis=-1)
221221
# Compute this in batches to never materialize an over-large
222222
# intermediate array.
223223
n_batches = 10

0 commit comments

Comments
 (0)