Skip to content

Mean_cuda not implemented for complex types #46982

@rjkilpatrick

Description

@rjkilpatrick

🐛 Bug

Tensor averaging not implemented for complex types

To Reproduce

>>> import torch
>>> x = torch.ones(4, dtype=torch.complex128).cuda()
>>> torch.mean(x)
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-108-34af2dc3edea> in <module>
      1 import torch
      2 x = torch.ones(4, dtype=torch.complex128).cuda()
----> 3 torch.mean(x)

RuntimeError: "mean_cuda" not implemented for 'ComplexDouble'

Same for float, torch.complex64, torch.complex32.

Expected behaviour

Calculates mean across tensor, e.g.

tensor(1., device='cuda:0', dtype=torch.complex128)

Environment

PyTorch version: 1.8.0.dev20201027
Is debug build: True
CUDA used to build PyTorch: 10.2
ROCM used to build PyTorch: N/A

OS: Manjaro Linux (x86_64)
GCC version: (GCC) 10.2.0
Clang version: 10.0.1
CMake version: version 3.18.3

Python version: 3.8 (64-bit runtime)
Is CUDA available: True
CUDA runtime version: Could not collect
GPU models and configuration: GPU 0: GeForce GTX 970
Nvidia driver version: 450.80.02
cuDNN version: Probably one of the following:
/usr/lib/libcudnn.so.8.0.2
/usr/lib/libcudnn_adv_infer.so.8.0.2
/usr/lib/libcudnn_adv_train.so.8.0.2
/usr/lib/libcudnn_cnn_infer.so.8.0.2
/usr/lib/libcudnn_cnn_train.so.8.0.2
/usr/lib/libcudnn_ops_infer.so.8.0.2
/usr/lib/libcudnn_ops_train.so.8.0.2
HIP runtime version: N/A
MIOpen runtime version: N/A

Versions of relevant libraries:
[pip3] numpy==1.19.2
[pip3] torch==1.8.0.dev20201027
[pip3] torchvision==0.9.0.dev20201027
[pip3] torchviz==0.0.1
[conda] blas 1.0 mkl
[conda] cudatoolkit 10.2.89 hfd86e86_1
[conda] mkl 2020.2 256
[conda] mkl-service 2.3.0 py38he904b0f_0
[conda] mkl_fft 1.2.0 py38h23d657b_0
[conda] mkl_random 1.1.1 py38h0573a6f_0
[conda] numpy 1.19.2 py38h54aff64_0
[conda] numpy-base 1.19.2 py38hfa32c7d_0
[conda] torch 1.8.0.dev20201026 pypi_0 pypi
[conda] torchvision 0.9.0.dev20201027 pypi_0 pypi
[conda] torchviz 0.0.1 pypi_0 pypi

cc @ezyang @anjali411 @dylanbespalko @mruberry

Metadata

Metadata

Assignees

No one assigned

    Labels

    function requestA request for a new function or the addition of new arguments/modes to an existing function.good first issuemodule: complexRelated to complex number support in PyTorchtriagedThis 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