Skip to content

[jit] index_put_ on a tensor slice with the element type does not work #27493

@driazati

Description

@driazati

This works in eager mode

# this works
def fn(x):
    a = zeros_like(x, dtype=torch.uint8)
    a[torch.tensor(0)] = torch.tensor(2)
    return a

# this works
def fn(x):
    a = zeros_like(x, dtype=torch.uint8)
    a[0] = 2
    return a

# this  doesn't work
def fn(x):
    a = zeros_like(x, dtype=torch.uint8)
    a[torch.tensor(0)] = 2
    return a

x = torch.jit.script(fn)

cc @suo

Metadata

Metadata

Assignees

Labels

oncall: jitAdd this issue/PR to JIT oncall triage queuesmallWe think this is a small issue to fix. Consider knocking off high priority small issuestriagedThis 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