pytorch/caffe2/python/operator_test
Igor Sugak 704e15307e [caffe2] replace refernces to np.asscalar (#121332) (#121545)
Summary:

`np.asscalar` was deprecated and removed in a recent Numpy. It used to be implemented the following way, and the recommended alternative is to call `item()` directly:
```python
def asscalar(a):
    return a.item()
```
This fixes all of the references.

Test Plan: visual inspection and automated tests

Differential Revision: D54697760

Pull Request resolved: https://github.com/pytorch/pytorch/pull/121545
Approved by: https://github.com/malfet
2024-03-12 16:58:47 +00:00
..
__init__.py
_utils.py Revert "remove assert_allclose from torch.testing (#87974)" 2022-11-04 19:12:37 +00:00
activation_ops_test.py replace all remaining occurrences of deadline=1000, to prevent test flakiness 2021-05-25 15:55:30 -07:00
adadelta_test.py replace all remaining occurrences of deadline=1000, to prevent test flakiness 2021-05-25 15:55:30 -07:00
adagrad_test_helper.py [codemod][numpy] replace np.str with str (#103931) 2023-06-21 18:16:42 +00:00
adagrad_test.py Weighted decay with frequency (count-based) (#60382) 2021-06-21 18:46:35 -07:00
adam_test.py [gpu ne eval] disable adam decay unit test for gpu (#66056) 2021-10-03 07:40:23 -07:00
affine_channel_op_test.py
alias_with_name_test.py
apmeter_test.py [CODEMOD][caffe2] replace numpy.bool with bool (#111432) 2023-10-18 18:56:40 +00:00
arg_ops_test.py
assert_test.py replace all remaining occurrences of deadline=1000, to prevent test flakiness 2021-05-25 15:55:30 -07:00
async_net_barrier_test.py [BE]: Apply pyupgrade yield from and unit test alias upgrades (#94309) 2023-02-07 20:08:58 +00:00
atomic_ops_test.py [BE]: Apply pyupgrade yield from and unit test alias upgrades (#94309) 2023-02-07 20:08:58 +00:00
basic_rnn_test.py
batch_box_cox_test.py
batch_bucketize_op_test.py
batch_moments_op_test.py
batch_sparse_to_dense_op_test.py [caffe2] Add support for int32 lengths in BatchSparseToDense (#58062) 2021-05-26 10:33:32 -07:00
bbox_transform_test.py replace all remaining occurrences of deadline=1000, to prevent test flakiness 2021-05-25 15:55:30 -07:00
bisect_percentile_op_test.py Clean up bisect_percentile_op (#73148) 2022-02-25 04:33:45 +00:00
blobs_queue_db_test.py
boolean_mask_test.py replace all remaining occurrences of deadline=1000, to prevent test flakiness 2021-05-25 15:55:30 -07:00
boolean_unmask_test.py
box_with_nms_limit_op_test.py replace all remaining occurrences of deadline=1000, to prevent test flakiness 2021-05-25 15:55:30 -07:00
bucketize_op_test.py
cast_op_test.py [codemod][numpy] replace np.str with str (#103931) 2023-06-21 18:16:42 +00:00
ceil_op_test.py
channel_backprop_stats_op_test.py
channel_shuffle_test.py
channel_stats_op_test.py
checkpoint_test.py
clip_op_test.py replace all remaining occurrences of deadline=1000, to prevent test flakiness 2021-05-25 15:55:30 -07:00
clip_tensor_op_test.py replace all remaining occurrences of deadline=1000, to prevent test flakiness 2021-05-25 15:55:30 -07:00
collect_and_distribute_fpn_rpn_proposals_op_test.py
concat_op_cost_test.py [CODEMOD][caffe2] replace uses of np.float with np.float64 (#112675) 2023-11-03 03:00:51 +00:00
concat_split_op_test.py
conditional_test.py
conftest.py
conv_test.py relax test deadlines 2021-05-25 15:02:52 -07:00
conv_transpose_test.py
copy_ops_test.py
copy_rows_to_tensor_op_test.py
cosine_embedding_criterion_op_test.py
counter_ops_test.py
crf_test.py replace all remaining occurrences of deadline=1000, to prevent test flakiness 2021-05-25 15:55:30 -07:00
cross_entropy_ops_test.py
ctc_beam_search_decoder_op_test.py
ctc_greedy_decoder_op_test.py
cudnn_recurrent_test.py [BE] Get rid of future (#92596) 2023-01-19 08:46:50 +00:00
data_couple_op_test.py
dataset_ops_test.py [BE]: Apply pyupgrade yield from and unit test alias upgrades (#94309) 2023-02-07 20:08:58 +00:00
decay_adagrad_test.py optimizer exploration - v1 and v2 + fix position_weighted optimizer + decoupled weight decay (#54042) 2021-03-27 23:03:29 -07:00
deform_conv_test.py
dense_vector_to_id_list_op_test.py
depthwise_3x3_conv_test.py
detectron_keypoints.py [codemod][numpy] replace np.str with str (#103931) 2023-06-21 18:16:42 +00:00
distance_op_test.py
dropout_op_test.py [CODEMOD][caffe2] replace uses of np.float with np.float64 (#112675) 2023-11-03 03:00:51 +00:00
duplicate_operands_test.py
elementwise_linear_op_test.py
elementwise_logical_ops_test.py
elementwise_op_broadcast_test.py Fix some typos. 2022-04-11 21:55:59 +00:00
elementwise_ops_test.py [CODEMOD][caffe2] replace numpy.bool with bool (#111432) 2023-10-18 18:56:40 +00:00
emptysample_ops_test.py
enforce_finite_op_test.py
ensure_clipped_test.py
ensure_cpu_output_op_test.py
erf_op_test.py replace all remaining occurrences of deadline=1000, to prevent test flakiness 2021-05-25 15:55:30 -07:00
expand_op_test.py replace all remaining occurrences of deadline=1000, to prevent test flakiness 2021-05-25 15:55:30 -07:00
fc_operator_test.py relax test deadlines 2021-05-25 15:02:52 -07:00
feature_maps_ops_test.py [CODEMOD][caffe2] replace uses of np.float with np.float64 (#112675) 2023-11-03 03:00:51 +00:00
filler_ops_test.py replace all remaining occurrences of deadline=1000, to prevent test flakiness 2021-05-25 15:55:30 -07:00
find_op_test.py
flatten_op_test.py
flexible_top_k_test.py replace all remaining occurrences of deadline=1000, to prevent test flakiness 2021-05-25 15:55:30 -07:00
floor_op_test.py
fused_nbit_rowwise_conversion_ops_test.py replace all remaining occurrences of deadline=1000, to prevent test flakiness 2021-05-25 15:55:30 -07:00
fused_nbit_rowwise_test_helper.py
fused_nbit_rowwise_test.cc
gather_ops_test.py replace all remaining occurrences of deadline=1000, to prevent test flakiness 2021-05-25 15:55:30 -07:00
gather_ranges_op_test.py replace all remaining occurrences of deadline=1000, to prevent test flakiness 2021-05-25 15:55:30 -07:00
given_tensor_byte_string_to_uint8_fill_op_test.py
given_tensor_fill_op_test.py
glu_op_test.py
group_conv_test.py
group_norm_op_test.py
gru_test.py
heatmap_max_keypoint_op_test.py [BE] [1/3] Rewrite super() calls in caffe2 and benchmarks (#94587) 2023-02-11 18:19:48 +00:00
histogram_test.py
hsm_test.py [BE]: Apply pyupgrade yield from and unit test alias upgrades (#94309) 2023-02-07 20:08:58 +00:00
hyperbolic_ops_test.py
im2col_col2im_test.py
image_input_op_test.py
index_hash_ops_test.py
index_ops_test.py [BE]: Apply pyupgrade yield from and unit test alias upgrades (#94309) 2023-02-07 20:08:58 +00:00
instance_norm_test.py replace all remaining occurrences of deadline=1000, to prevent test flakiness 2021-05-25 15:55:30 -07:00
integral_image_ops_test.py
jsd_ops_test.py
key_split_ops_test.py
lars_test.py
layer_norm_op_test.py prepare removal of deprecated functionality in torch.testing (#87969) 2022-11-02 14:04:48 +00:00
leaky_relu_test.py
learning_rate_adaption_op_test.py
learning_rate_op_test.py
length_split_op_test.py replace all remaining occurrences of deadline=1000, to prevent test flakiness 2021-05-25 15:55:30 -07:00
lengths_pad_op_test.py
lengths_reducer_fused_nbit_rowwise_ops_test.py
lengths_tile_op_test.py
lengths_top_k_ops_test.py
listwise_l2r_operator_test.py
load_save_test.py [CODEMOD][caffe2] replace numpy.bool with bool (#111432) 2023-10-18 18:56:40 +00:00
locally_connected_op_test.py relax test deadlines 2021-05-25 15:02:52 -07:00
loss_ops_test.py
lpnorm_op_test.py [caffe2] Allow LpNorm to accept empty tensor (#72660) 2022-02-11 23:14:02 +00:00
map_ops_test.py
margin_loss_l2r_operator_test.py [1/n][caffe2] Add session based margin loss function in caffe2 operator 2022-01-21 23:13:36 +00:00
margin_ranking_criterion_op_test.py replace all remaining occurrences of deadline=1000, to prevent test flakiness 2021-05-25 15:55:30 -07:00
math_ops_test.py
matmul_op_test.py replace all remaining occurrences of deadline=1000, to prevent test flakiness 2021-05-25 15:55:30 -07:00
mean_op_test.py Lint trailing newlines (#54737) 2021-03-30 13:09:52 -07:00
merge_id_lists_op_test.py
mkl_conv_op_test.py
mkl_packed_fc_op_test.py
mod_op_test.py
moments_op_test.py
momentum_sgd_test.py
mpi_test.py
mul_gradient_benchmark.py [dte] fastpath implementations for mulgrad / divgrad (3/x) (#62437) 2021-07-30 00:05:34 -07:00
negate_gradient_op_test.py
ngram_ops_test.py
normalize_op_test.py
numpy_tile_op_test.py
one_hot_ops_test.py replace all remaining occurrences of deadline=1000, to prevent test flakiness 2021-05-25 15:55:30 -07:00
onnx_while_test.py [CODEMOD][caffe2] replace numpy.bool with bool (#111432) 2023-10-18 18:56:40 +00:00
order_switch_test.py
pack_ops_test.py [CODEMOD][caffe2] replace numpy.bool with bool (#111432) 2023-10-18 18:56:40 +00:00
pack_rnn_sequence_op_test.py
pad_test.py
partition_ops_test.py
percentile_op_test.py
piecewise_linear_transform_test.py Disable GPU tests for the PiecewiseLinearTransform operator. (#75738) 2022-04-14 12:07:50 +00:00
pooling_test.py replace all remaining occurrences of deadline=1000, to prevent test flakiness 2021-05-25 15:55:30 -07:00
prepend_dim_test.py
python_op_test.py replace all remaining occurrences of deadline=1000, to prevent test flakiness 2021-05-25 15:55:30 -07:00
quantile_test.py
rand_quantization_op_speed_test.py
rank_loss_operator_test.py [caffe2] replace refernces to np.asscalar (#121332) (#121545) 2024-03-12 16:58:47 +00:00
rebatching_queue_test.py [BE]: Apply pyupgrade yield from and unit test alias upgrades (#94309) 2023-02-07 20:08:58 +00:00
record_queue_test.py
recurrent_net_executor_test.py [BE] [1/3] Rewrite super() calls in caffe2 and benchmarks (#94587) 2023-02-11 18:19:48 +00:00
recurrent_network_test.py
reduce_ops_test.py [dte] fastpath implementation for broadcast utility function (4/x) (#62493) 2021-07-30 16:15:10 -07:00
reduction_ops_test.py
reshape_ops_test.py
resize_op_test.py
rmac_regions_op_test.py
rms_norm_op_test.py
rnn_cell_test.py
roi_align_rotated_op_test.py Fix exception causes all over the codebase (#90271) 2022-12-07 04:29:00 +00:00
rowwise_counter_test.py
scale_op_test.py
segment_ops_test.py
self_binning_histogram_test.py [CODEMOD][caffe2] replace uses of np.float with np.float64 (#112675) 2023-11-03 03:00:51 +00:00
selu_op_test.py replace all remaining occurrences of deadline=1000, to prevent test flakiness 2021-05-25 15:55:30 -07:00
sequence_ops_test.py Fix sequence_ops_test (#72844) 2022-02-15 06:49:38 +00:00
shape_inference_test.py [CODEMOD][caffe2] replace numpy.bool with bool (#111432) 2023-10-18 18:56:40 +00:00
sinusoid_position_encoding_op_test.py replace all remaining occurrences of deadline=1000, to prevent test flakiness 2021-05-25 15:55:30 -07:00
softmax_ops_test.py relax test deadlines 2021-05-25 15:02:52 -07:00
softplus_op_test.py replace all remaining occurrences of deadline=1000, to prevent test flakiness 2021-05-25 15:55:30 -07:00
sparse_dropout_with_replacement_op_test.py
sparse_gradient_checker_test.py
sparse_itemwise_dropout_with_replacement_op_test.py [itemwise-dropout][1/x][low-level module] Implement Itemwise Sparse Feature Dropout in Dper3 (#59322) 2021-06-04 19:59:17 -07:00
sparse_lengths_sum_benchmark.py
sparse_lp_regularizer_test.py
sparse_normalize_test.py Clean up future imports for Python 2 (#53349) 2021-03-14 15:56:13 -07:00
sparse_ops_test.py [1/n]support double for Caffe2 ScatterWeightedSum (#60402) 2021-06-29 14:17:04 -07:00
sparse_to_dense_mask_op_test.py replace all remaining occurrences of deadline=1000, to prevent test flakiness 2021-05-25 15:55:30 -07:00
spatial_bn_op_test.py [c2] Fix flaky test_spatial_bn_multi_batch_grad 2021-05-06 12:50:53 -07:00
specialized_segment_ops_test.py
split_op_cost_test.py Add CostInferenceFunction for SplitOp (#63133) 2021-08-13 12:28:15 -07:00
square_root_divide_op_test.py
stats_ops_test.py
stats_put_ops_test.py [CODEMOD][caffe2] replace uses of np.float with np.float64 (#112675) 2023-11-03 03:00:51 +00:00
storm_test.py
string_ops_test.py [caffe2] replace numpy.object with object (#111494) 2023-10-19 04:37:00 +00:00
text_file_reader_test.py
thresholded_relu_op_test.py
tile_op_test.py [codemod][numpy] replace np.str with str (#103931) 2023-06-21 18:16:42 +00:00
top_k_test.py replace all remaining occurrences of deadline=1000, to prevent test flakiness 2021-05-25 15:55:30 -07:00
torch_integration_test.py prepare removal of deprecated functionality in torch.testing (#87969) 2022-11-02 14:04:48 +00:00
transpose_op_test.py
trigonometric_op_test.py
unique_ops_test.py
unique_uniform_fill_op_test.py
unsafe_coalesce_test.py [BE]: Apply pyupgrade yield from and unit test alias upgrades (#94309) 2023-02-07 20:08:58 +00:00
upsample_op_test.py
utility_ops_test.py replace all remaining occurrences of deadline=1000, to prevent test flakiness 2021-05-25 15:55:30 -07:00
video_input_op_test.py Fix exception causes all over the codebase (#90271) 2022-12-07 04:29:00 +00:00
weight_scale_test.py
weighted_multi_sample_test.py
weighted_sample_test.py
weighted_sum_test.py replace all remaining occurrences of deadline=1000, to prevent test flakiness 2021-05-25 15:55:30 -07:00
wngrad_test.py replace all remaining occurrences of deadline=1000, to prevent test flakiness 2021-05-25 15:55:30 -07:00