Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interior padding not supported in EMLX #64

Open
ndrean opened this issue Dec 7, 2024 · 1 comment
Open

Interior padding not supported in EMLX #64

ndrean opened this issue Dec 7, 2024 · 1 comment

Comments

@ndrean
Copy link

ndrean commented Dec 7, 2024

t = Nx.tensor([1,2,3])
one_zero_left = Nx.pad(t, 0, [{1,0,0}])
# [0, 1, 2, 3] :ok
two_5_right = Nx.pad(t, 5, [{0,2,0}])
# [1, 2, 3, 5, 5] :ok
spaced_with_three_five_from_left = Nx.pad(t, 5, [{1, 0, 3}])

Shape mismatch in MLX array conversion:
Expected shape: {10}
Got shape: {4}

    (emlx 0.1.0) lib/emlx/backend.ex:360: EMLX.Backend.check_shape_and_type!/3
    (emlx 0.1.0) lib/emlx/backend.ex:53: EMLX.Backend.to_nx/2
    (nx 0.9.2) lib/nx.ex:5408: Nx.apply_vectorized/2
@polvalente polvalente changed the title Nx.pad: pb with "pad_width_interior" Interior padding not supported in EMLX Dec 7, 2024
@polvalente
Copy link
Collaborator

I've updated main with a better error message, but the fact is that interior padding is not yet supported in Nx.pad.
Adding this will also unlock the ability to do dilations in window_* functions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants