Repository: pytorch
Issue: Finishing OpInfos: test_autograd.py
Labels: module: autograd,module: tests,triaged,better-engineering,hackathon

The following tests in autograd.py should be reviewed to see if they can be replaced with OpInfo-based tests or moved to the relevant function's test suite so the tests related to an operator are colocated:

EDIT: Some of the tests in the original list have been resolved following some initial investigation, so original list has been edited.

**What's left to do:**

The following should be placed in the correct test suite, the ones that are not marked with "still in test_autograd.py" have already been moved. Further investigation is necessary to compare what is tested in these tests and see if they can be merged into the related OpInfo (some of them don't have one yet). If it is determined that merging with the related OpInfo is not possible, it would be useful to record this in a code comment.
- [ ] test_pow_scalar_base in test_binary_ufuncs
- [x] ~test_resize_out_of_place in test_view_ops~
- [ ] test_cdist_euclidean_large in test_torch
- [ ] test_cdist_grad_p_lt_1_no_nan in test_torch
- [ ] test_cdist_same_inputs in test_torch
- [x] ~test_xlogy_gradients test_binary_ufuncs~
- [ ] test_where_functional (still in test_autograd.py)
- [ ] test_where_scalar  (still in test_autograd.py)
- [x] ~test_old_slogdet_sign (Note that slogdet is deprecated and this test may be unnecessary) in test_linalg~
- [ ] run_symeig_test (Note that symeig is deprecated and this test may be unnecessary)
- [ ] test_lobpcg  (still in test_autograd.py)
- [ ] test_diagonal_derivative_requires_grad  (still in test_autograd.py)
- [ ] test_eig_no_eigenvectors  (still in test_autograd.py)
- [ ] test_eig_complex_eigenvalues  (still in test_autograd.py)
- [ ] test_symeig_no_eigenvectors  (still in test_autograd.py)
- [ ] test_svd_no_signularvectors  (still in test_autograd.py)
- [ ] test_min_max_median_backprops_to_all_values  (still in test_autograd.py)
- [ ] test_ctc_loss in test_nn.py
- [ ] test_ctc_loss_cudnn in test_nn.py
- [x] ~test_nan_to_num_gradient in test_unary_ufuncs.py~
- [x] ~test_nansum_with_nans in test_reductions.py~

These probably don't have OpInfos yet.
- [ ] test_LSTM_grad_and_gradgrad in test_nn.py
- [ ] test_GRU_grad_and_gradgrad in test_nn.py
- [ ] test_pdist_large in test_nn.py
- [ ] test_elu_inplace_with_neg_alpha in test_nn.py
- [ ] test_leaky_relu_inplace_with_neg_slope in test_nn.py
- [ ] test_leaky_relu_inplace_with_zero_slope in test_nn.py
- [ ] test_as_strided in test_view_ops
- [ ] test_unbind (still in test_autograd.py)
- [ ] test_reduce_dtype in test_reductions (deals with multiple ops)
- [ ] test_atleast_gradient in test_view_ops
- [ ] _test_sparse_gather (still in test_autograd.py)

**Completed:**

non-gradcheck checks should be manually tested. We placed these in the correct test suite
- [X] test_maximum_and_minimum_subgradient
- [X] ~test_norm_subgradient (Note that we are deprecating torch.norm in favor of linalg.{matrix, vector, }norm~
- [X] ~test_norm_inf_subradient <-- moving these two to the proper test suite for now: test_linalg, but marked as old~
- [X] test_nansum_dtype
- [X] test_copysign_subgradient

These should stay in test_autograd because they test generic autograd behavior:
- [X] test_non_differentiable_ops
- [X] test_mul_out, test_mul_out_result_requires_grad (combined and renamed to test_out_variant_raises_when_inputs_require_grad)
- [X] test_sum_to_with_empty_dim_grad (renamed to test_accumulate_with_zero_numel_grad)

Merged into OpInfo:
- [X] test_fill
- [X] test_logcumsumexp_large_value
- [X] test_lerp_tensor_weights

Not possible to merge:
- [X] test_sinc (we want to test extermal values on gradcheck but not gradgradcheck)

cc @ezyang @albanD @zou3519 @gqchen @pearu @nikitaved @soulitzer @Lezcano @Varal7 @mruberry