diff --git a/examples/legacy/seq2seq/utils.py b/examples/legacy/seq2seq/utils.py index 2e0586a269b..e207e4d0dbd 100644 --- a/examples/legacy/seq2seq/utils.py +++ b/examples/legacy/seq2seq/utils.py @@ -371,7 +371,7 @@ def sortish_sampler_indices(data: List, bs: int, shuffle=True) -> np.array: ck_idx = [sort_idx[i : i + sz] for i in range(0, len(sort_idx), sz)] max_ck = np.argmax([key_fn(ck[0]) for ck in ck_idx]) # find the chunk with the largest key, ck_idx[0], ck_idx[max_ck] = ck_idx[max_ck], ck_idx[0] # then make sure it goes first. - sort_idx = np.concatenate(np.random.permutation(ck_idx[1:])) if len(ck_idx) > 1 else np.array([], dtype=np.int) + sort_idx = np.concatenate(np.random.permutation(ck_idx[1:])) if len(ck_idx) > 1 else np.array([], dtype=int) sort_idx = np.concatenate((ck_idx[0], sort_idx)) return sort_idx diff --git a/examples/pytorch/benchmarking/plot_csv_file.py b/examples/pytorch/benchmarking/plot_csv_file.py index 58dc50bb832..1a0ae735d8c 100644 --- a/examples/pytorch/benchmarking/plot_csv_file.py +++ b/examples/pytorch/benchmarking/plot_csv_file.py @@ -132,7 +132,7 @@ class Plot: if self.args.plot_along_batch: y_axis_array = np.asarray( [results[(x, inner_loop_value)] for x in x_axis_array if (x, inner_loop_value) in results], - dtype=np.int, + dtype=int, ) else: y_axis_array = np.asarray( @@ -144,7 +144,7 @@ class Plot: ("batch_size", "len") if self.args.plot_along_batch else ("in #tokens", "bsz") ) - x_axis_array = np.asarray(x_axis_array, np.int)[: len(y_axis_array)] + x_axis_array = np.asarray(x_axis_array, int)[: len(y_axis_array)] plt.scatter( x_axis_array, y_axis_array, label=f"{label_model_name} - {inner_loop_label}: {inner_loop_value}" ) diff --git a/examples/research_projects/seq2seq-distillation/utils.py b/examples/research_projects/seq2seq-distillation/utils.py index b6994a1831d..a45194e6e05 100644 --- a/examples/research_projects/seq2seq-distillation/utils.py +++ b/examples/research_projects/seq2seq-distillation/utils.py @@ -353,7 +353,7 @@ def sortish_sampler_indices(data: List, bs: int, shuffle=True) -> np.array: ck_idx = [sort_idx[i : i + sz] for i in range(0, len(sort_idx), sz)] max_ck = np.argmax([key_fn(ck[0]) for ck in ck_idx]) # find the chunk with the largest key, ck_idx[0], ck_idx[max_ck] = ck_idx[max_ck], ck_idx[0] # then make sure it goes first. - sort_idx = np.concatenate(np.random.permutation(ck_idx[1:])) if len(ck_idx) > 1 else np.array([], dtype=np.int) + sort_idx = np.concatenate(np.random.permutation(ck_idx[1:])) if len(ck_idx) > 1 else np.array([], dtype=int) sort_idx = np.concatenate((ck_idx[0], sort_idx)) return sort_idx diff --git a/examples/tensorflow/benchmarking/plot_csv_file.py b/examples/tensorflow/benchmarking/plot_csv_file.py index 58dc50bb832..1a0ae735d8c 100644 --- a/examples/tensorflow/benchmarking/plot_csv_file.py +++ b/examples/tensorflow/benchmarking/plot_csv_file.py @@ -132,7 +132,7 @@ class Plot: if self.args.plot_along_batch: y_axis_array = np.asarray( [results[(x, inner_loop_value)] for x in x_axis_array if (x, inner_loop_value) in results], - dtype=np.int, + dtype=int, ) else: y_axis_array = np.asarray( @@ -144,7 +144,7 @@ class Plot: ("batch_size", "len") if self.args.plot_along_batch else ("in #tokens", "bsz") ) - x_axis_array = np.asarray(x_axis_array, np.int)[: len(y_axis_array)] + x_axis_array = np.asarray(x_axis_array, int)[: len(y_axis_array)] plt.scatter( x_axis_array, y_axis_array, label=f"{label_model_name} - {inner_loop_label}: {inner_loop_value}" )