pytorch
f51516df - Adding `broadcast_in_dim` and non-contiguous Tensor support NVFuser Python Frontend

Commit
2 years ago
Adding `broadcast_in_dim` and non-contiguous Tensor support NVFuser Python Frontend Adding new features. 1. `broadcast_in_dim` support and example. 2. Adding non-contiguous `TensorView` support and example. `broadcast_in_dim` example: ``` with FusionDefinition(fusion) as fd : t0 = fd.define_tensor(1) t1 = fd.define_tensor(3) fd.add_input(t0) fd.add_input(t1) t0_b = fd.Ops.broadcast_in_dim(t0, [2, 3, 4], [1]) t2 = fd.Ops.add(t0_b, t1) fd.add_output(t2) ``` Non-contiguous tensor support example: ``` with FusionDefinition(fusion) as fd : t0 = fd.define_tensor(3, [False, False, False]) t1 = fd.define_tensor(3, [True, True, True]) fd.add_input(t0) fd.add_input(t1) print("Input1 Contiguity:", t0) print("Input2 Contiguity:", t1) t2 = fd.Ops.add(t0, t1) print("Output Contiguity:", t2, "\n") fd.add_output(t2) ``` Pull Request resolved: https://github.com/pytorch/pytorch/pull/76484 Approved by: https://github.com/mruberry
Author
Committer
Parents
Loading