(x, c)
| 713 | def test_pow_const_direct(self): |
| 714 | # x ** c |
| 715 | def get_tiny_gradient(x, c): |
| 716 | t = Tensor([x], dtype=dtypes.float) |
| 717 | return (t ** c)[0].gradient(t)[0].item() |
| 718 | def get_torch_gradient(x, c): |
| 719 | t = torch.tensor([x], dtype=torch.float, requires_grad=True) |
| 720 | return torch.autograd.grad(t ** c, t)[0].item() |