trunk/3c512baeddc8fdc688d905a33baf89d97ebb050e: Dispatch `index_put_` to `masked_fill_.Scalar` when possible (#188330)
- PyTorch: 350 events in the last 90 days
- PyTorch: 347th Release in the last 90 days
- Previous: earlier the same day · trunk/d47079b9af35a44e41096b04cebad64c0caa89f5: Add zoranzhao for as PyTorch reviewer (#195514)
What happened
This is a followup on #188267 and #61612 and tries to dispatch index_put_ to masked_fill_.Scalar where possible - e.g. gpu_tensor[mask] = 1.0 - instead of converting the scalar to a CPU tensor first. While this prevents an unnecessary CPU tensor, it has the main advantage that we don't need any special handling for scalarToTensor anymore. Instead, we can directly convert scalars to a GPU tensor, so that advanced ind…
Summary assembled by rule from the sources below