Skip to content

Does torch_directml support torch.nn.functional.pad function? #387

@factfinding

Description

@factfinding

I found that the Instance segmentation result is not correct when running the official maskrcnn sample in this library. The reason looks like the torch.nn.functional.pad function is not working properly. I made a simple test to reproduce this error. The code shows as below:
import torch
import torch_directml
tensor = torch.tensor([[[[1]]]])
tensor_pad = torch.nn.functional.pad(tensor, (1,) * 4)
tensor_pad_dml = torch.nn.functional.pad(tensor.to(torch_directml.device(0)), (1,) * 4)
And the result shows as follows:
image
It looks like when run torch.nn.functional.pad function in dml device, the result becomes a tensor of all zeros. I run this test in both amd rx480 and Intel Iris Plus Graphics, the result is same. Does torch_directml support torch.nn.functional.pad function?
Environment
Python 3.8.10
torch 1.13.1
torch-directml 0.1.13.1.dev230119
AMD Radeon RX 480
AMD Software: Adrenalin Edition 22.11.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    pytorch-directmlIssues in PyTorch when using its DirectML backend

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions