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

Small fix: documentation of Tensor::stack #1105

Merged
merged 1 commit into from
Jan 8, 2024
Merged

Conversation

PonasKovas
Copy link
Contributor

Changes

Changed the documentation on Tensor::stack function to be less confusing and misleading.

use burn::{
    backend::NdArray,
    tensor::{Int, Tensor},
};

fn main() {
    type B = NdArray;

    let v1 = Tensor::<B, 1, Int>::arange(2..5);
    let v2 = Tensor::<B, 1, Int>::arange(1..4);

    // Runtime error, even though `dim: 2` falls in the range of `0..=D2`.
    dbg!(Tensor::stack::<2>(vec![v1, v2], 2));
}

This probably must have been a simple typo or misunderstanding, since we index dimensions from 0, so if your tensor has D2 dimensions, the highest you can index is D2-1.

Copy link
Member

@louisfd louisfd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, you're right about that

@louisfd louisfd merged commit e132e21 into tracel-ai:main Jan 8, 2024
2 of 12 checks passed
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

Successfully merging this pull request may close these issues.

2 participants