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

Add more examples of runtime dimensions to examples/02-ops.rs #593

Closed
Tracked by #577
coreylowman opened this issue Mar 21, 2023 · 0 comments · Fixed by #698
Closed
Tracked by #577

Add more examples of runtime dimensions to examples/02-ops.rs #593

coreylowman opened this issue Mar 21, 2023 · 0 comments · Fixed by #698
Labels
good first issue Good for newcomers

Comments

@coreylowman
Copy link
Owner

coreylowman commented Mar 21, 2023

Currently examples/01-tensor.rs shows how to create tensors with runtime dimensions, but there are no corresponding examples in 02-ops.rs.

  1. Add some of the tensors in examples/02-tensor to use both runtime & const dimensions.
  2. Change the first matmul call to use both runtime & const dims
  3. Show an example of using RealizeTo trait to add tensors with different types of dimensions:
let a: Tensor<(Const<3>, usize), f32, _> = dev.sample_uniform_like(&(Const, 5));
let b: Tensor<(usize, Const<5>), f32, _> = dev.sample_uniform_like(&(3, Const));
let c = a + b.realize().unwrap();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant