Skip to content

MPS constant_pad_nd fails with empty pad list #161066

@manuelcandales

Description

@manuelcandales

🐛 Describe the bug

>>> import torch
>>> torch.constant_pad_nd(torch.ones([2, 3], device="cpu"), [])
tensor([[1., 1., 1.],
        [1., 1., 1.]])
>>> torch.constant_pad_nd(torch.ones([2, 3], device="mps"), [])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
RuntimeError: invalid padding argument of size 0

Versions

nightly

cc @malfet @kulinseth @albanD @DenisVieriu97 @jhavukainen

Metadata

Metadata

Assignees

No one assigned

    Labels

    module: error checkingBugs related to incorrect/lacking error checkingmodule: mpsRelated to Apple Metal Performance Shaders frameworktriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions