docstr: 测试转换后梯度的反向传播
docstr_tok: ["\u6d4b\u8bd5\u8f6c\u6362\u540e\u68af\u5ea6\u7684\u53cd\u5411\u4f20\u64ad"]
code: def test_gradient(self):
      """
      测试转换后梯度的反向传播
      """
  
      x = torch.tensor([1.0, 2.0, 3.0, 4.0, 5.0], requires_grad=True)
      y = torch2paddle(x)
      z = 3 * (y**2)
      z.sum().backward()
      assert y.grad.tolist() == [6, 12, 18, 24, 30]
  
imports: import pytest
  from fastNLP.envs.imports import _NEED_IMPORT_JITTOR, _NEED_IMPORT_PADDLE, _NEED_IMPORT_TORCH
  from fastNLP.modules.mix_modules.utils import paddle2torch, torch2paddle, jittor2torch, torch2jittor
label_desc: Use image node_id 2 for calling the TestTorch2Paddle obj's underlying member method code with example usage: obj.test_gradient() without return types