Skip to content

Fuser breaks on input with size 0 #22747

@luisa-uber

Description

@luisa-uber

🐛 Bug

Fused kernel error when using simple method with inputs of size 0.

To Reproduce

Steps to reproduce the behavior:

import torch

@torch.jit.script
def decode(sin_t, cos_t):
    theta = torch.atan2(sin_t.float(), cos_t.float())
    return theta

sin = torch.zeros(0, device="cuda")
cos = torch.zeros(0, device="cuda")
print decode(sin, cos)

The error is:

Traceback (most recent call last):
  File "/home/luisasm/test.py", line 14, in <module>
    print decode(sin, cos)
RuntimeError: ../torch/csrc/jit/fuser/cuda/fused_kernel.cpp:248: invalid argument
The above operation failed in interpreter, with the following stack trace:

Environment

  • PyTorch Version (e.g., 1.0): 1.2.0a0+1ffa9d3

Metadata

Metadata

Assignees

Labels

oncall: jitAdd this issue/PR to JIT oncall triage queuetriagedThis 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