(self)
| 154 | ) |
| 155 | |
| 156 | def test_gradient_inplace(self) -> None: |
| 157 | model = BasicModel_MultiLayer(inplace=True) |
| 158 | input = torch.tensor([[1.0, 6.0, -3.0]], requires_grad=True) |
| 159 | grads = compute_gradients(model, input, target_ind=0)[0] |
| 160 | assertTensorAlmostEqual(self, grads, [[3.0, 3.0, 3.0]], delta=0.01, mode="max") |
| 161 | |
| 162 | def test_layer_gradient_linear0(self) -> None: |
| 163 | model = BasicModel_MultiLayer() |
nothing calls this directly
no test coverage detected