(mod, inp, doup)
| 26 | |
| 27 | @jit.xla_trace(without_host=True) |
| 28 | def func(mod, inp, doup): |
| 29 | gm.attach(inp) |
| 30 | with gm: |
| 31 | oup = mod(inp) |
| 32 | gm.backward(oup, doup) |
| 33 | return oup, inp.grad |
| 34 | |
| 35 | mge_rsts = func(mod, inp, doup) |
| 36 | xla_rsts = func(mod, inp, doup) |