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

vmap should accept a dim_size=None argument #1081

Open
zou3519 opened this issue Dec 9, 2022 · 0 comments
Open

vmap should accept a dim_size=None argument #1081

zou3519 opened this issue Dec 9, 2022 · 0 comments
Labels
actionable It is clear what should be done for this issue small

Comments

@zou3519
Copy link
Contributor

zou3519 commented Dec 9, 2022

vmap should accept a dim_size=None argument where the user is allowed to specify the size of the dimension being vmapped over. Should behave similarly to JAX's axis_name argument.

The net effect of this is that one should be able to vmap over functions that do not take Tensors as input!

def f():
  return torch.tensor(1.)

result = vmap(f, dim_size=5)()
assert torch.allclose(result, torch.tensor([1., 1., 1., 1., 1.]))

We should also investigate if there are other things that the axis_size arg in JAX provides.

@zou3519 zou3519 added actionable It is clear what should be done for this issue small labels Dec 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
actionable It is clear what should be done for this issue small
Projects
None yet
Development

No branches or pull requests

1 participant