Skip to content

Tensor.masked_fill treats DoubleTensor masks as BoolTensor masks of all False #85063

@gpetters94

Description

@gpetters94

🐛 Describe the bug

Tensor.masked_fill treats a DoubleTensor mask as a BoolTensor of all False, which as @ramiro050 pointed out is inconsistent with masked_select. Is this expected behavior or should passing a DoubleTensor produce a runtime error like it does for masked_select?

Versions

PyTorch version: 1.13.0.dev20220913+cpu
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A

OS: Debian GNU/Linux 11 (bullseye) (x86_64)
GCC version: (Debian 10.2.1-6) 10.2.1 20210110
Clang version: Could not collect
CMake version: version 3.24.1
Libc version: glibc-2.34

Python version: 3.10.7+ (heads/3.10:4e1303b, Sep 12 2022, 19:13:46) [GCC 10.2.1 20210110] (64-bit runtime)
Python platform: Linux-5.10.0-16-amd64-x86_64-with-glibc2.34
Is CUDA available: False
CUDA runtime version: No CUDA
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

Versions of relevant libraries:
[pip3] numpy==1.23.3
[pip3] torch==1.13.0.dev20220913+cpu
[pip3] torchvision==0.14.0.dev20220913+cpu
[conda] Could not collect

Metadata

Metadata

Assignees

No one assigned

    Labels

    module: error checkingBugs related to incorrect/lacking error checkingmodule: masked operatorsMasked operationstriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions