(inp, dout)
| 24 | |
| 25 | @jit.xla_trace(without_host=True) |
| 26 | def func(inp, dout): |
| 27 | gm.attach([inp]) |
| 28 | with gm: |
| 29 | out = F.broadcast_to(inp, tgtshape) |
| 30 | gm.backward(out, dout) |
| 31 | return [out, inp.grad] |
| 32 | |
| 33 | mge_rsts = func(inp, dout) |
| 34 | xla_rsts = func(inp, dout) |