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

broadcast & permute need to check that non-broadcast dims are the same for usize dims #445

Closed
coreylowman opened this issue Feb 13, 2023 · 0 comments · Fixed by #454
Closed
Labels
bug Something isn't working

Comments

@coreylowman
Copy link
Owner

Right now the broadcast/permute shape traits are implemented for any Dim, meaning they also apply to usize. This means it is possible to do:

use dfdx::prelude::*;

fn main() {
    let dev: Cpu = Default::default();

    let a: Tensor<(usize,), f32, _> = dev.zeros_like(&(3,));
    let b = a.broadcast_like::<_, Axis<0>>(&(2, 5));
    println!("{:?}", b);
}
@coreylowman coreylowman added the bug Something isn't working label Feb 13, 2023
coreylowman added a commit that referenced this issue Feb 15, 2023
coreylowman added a commit that referenced this issue Feb 15, 2023
* #445 Check broadcast shapes

* #448 runtime shape checks for select/gather

* Making inline always
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant