← 返回事件
持续讨论AI发版1.0

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

图:PyTorch Releases

发生了什么

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…

摘要按规则整理自下方来源原文

为什么在扩散

来源