← Back to events
ActiveAIRelease1.0

trunk/3c512baeddc8fdc688d905a33baf89d97ebb050e: Dispatch `index_put_` to `masked_fill_.Scalar` when possible (#188330)

Photo: PyTorch Releases

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

Why it's spreading

Sources