Skip to content

torch.nn.functional.{instance, batch}_norm trigger INTERNAL ASSERT FAILED when input is empty tensor with complex32 #71635

@ilovepytorch

Description

@ilovepytorch

🐛 Describe the bug

torch.nn.functional.{instance, batch}_norm trigger INTERNAL ASSERT FAILED when input is empty tensor with complex32

import torch
input  = torch.rand([1, 0, 2], dtype=torch.complex32)
running_mean = torch.rand([])
running_var = torch.rand([])
torch.nn.functional.instance_norm(input)
# RuntimeError: falseINTERNAL ASSERT FAILED at "../aten/src/ATen/AccumulateType.cpp":16, please report a bug to PyTorch. Unrecognized ScalarType: ComplexHalf
torch.nn.functional.batch_norm(input, running_mean, running_var)
# RuntimeError: falseINTERNAL ASSERT FAILED at "../aten/src/ATen/AccumulateType.cpp":16, please report a bug to PyTorch. Unrecognized ScalarType: ComplexHalf

Versions

pytorch: 1.10.1

cc @ezyang @anjali411 @dylanbespalko @mruberry @lezcano @nikitaved

Metadata

Metadata

Assignees

No one assigned

    Labels

    module: complexRelated to complex number support in PyTorchmodule: halfRelated to float16 half-precision floatstriagedThis 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