From 689ac2c55bf337e9a9c156e200353ee231e287e4 Mon Sep 17 00:00:00 2001 From: Antoine Beyeler <49431240+abey79@users.noreply.github.com> Date: Fri, 27 Oct 2023 11:18:01 +0200 Subject: [PATCH] Fix `tensor_simple` label ordering in Rust and C++ to match Python (#4035) ### What The label ordering was inverted in the C++ and Rust version of `tensor_simple`, compared to Python. ### Checklist * [x] I have read and agree to [Contributor Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and the [Code of Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md) * [x] I've included a screenshot or gif (if applicable) * [x] I have tested [demo.rerun.io](https://demo.rerun.io/pr/4035) (if applicable) * [x] The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG - [PR Build Summary](https://build.rerun.io/pr/4035) - [Docs preview](https://rerun.io/preview/4dbc6b9bf35da4355b082f0b453cc0d5851aa5e8/docs) - [Examples preview](https://rerun.io/preview/4dbc6b9bf35da4355b082f0b453cc0d5851aa5e8/examples) - [Recent benchmark results](https://ref.rerun.io/dev/bench/) - [Wasm size tracking](https://ref.rerun.io/dev/sizes/) --- crates/re_types/src/archetypes/tensor.rs | 2 +- docs/code-examples/tensor_simple.cpp | 2 +- docs/code-examples/tensor_simple.rs | 2 +- rerun_cpp/src/rerun/archetypes/tensor.hpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/re_types/src/archetypes/tensor.rs b/crates/re_types/src/archetypes/tensor.rs index 7af7b8d81d80..c5fd50910865 100644 --- a/crates/re_types/src/archetypes/tensor.rs +++ b/crates/re_types/src/archetypes/tensor.rs @@ -37,7 +37,7 @@ use ::re_types_core::{DeserializationError, DeserializationResult}; /// data.map_inplace(|x| *x = rand::random()); /// /// let tensor = -/// rerun::Tensor::try_from(data)?.with_dim_names(["batch", "channel", "height", "width"]); +/// rerun::Tensor::try_from(data)?.with_dim_names(["width", "height", "channel", "batch"]); /// rec.log("tensor", &tensor)?; /// /// Ok(()) diff --git a/docs/code-examples/tensor_simple.cpp b/docs/code-examples/tensor_simple.cpp index 1457bb848d6a..f84a98550f17 100644 --- a/docs/code-examples/tensor_simple.cpp +++ b/docs/code-examples/tensor_simple.cpp @@ -17,6 +17,6 @@ int main() { rec.log( "tensor", - rerun::Tensor({8, 6, 3, 5}, data).with_dim_names({"batch", "channel", "height", "width"}) + rerun::Tensor({8, 6, 3, 5}, data).with_dim_names({"width", "height", "channel", "batch"}) ); } diff --git a/docs/code-examples/tensor_simple.rs b/docs/code-examples/tensor_simple.rs index f8fa50b74649..e8901735558d 100644 --- a/docs/code-examples/tensor_simple.rs +++ b/docs/code-examples/tensor_simple.rs @@ -10,7 +10,7 @@ fn main() -> Result<(), Box> { data.map_inplace(|x| *x = rand::random()); let tensor = - rerun::Tensor::try_from(data)?.with_dim_names(["batch", "channel", "height", "width"]); + rerun::Tensor::try_from(data)?.with_dim_names(["width", "height", "channel", "batch"]); rec.log("tensor", &tensor)?; Ok(()) diff --git a/rerun_cpp/src/rerun/archetypes/tensor.hpp b/rerun_cpp/src/rerun/archetypes/tensor.hpp index 2317fcba4d67..2590b2309d60 100644 --- a/rerun_cpp/src/rerun/archetypes/tensor.hpp +++ b/rerun_cpp/src/rerun/archetypes/tensor.hpp @@ -40,7 +40,7 @@ namespace rerun { /// /// rec.log( /// "tensor", - /// rerun::Tensor({8, 6, 3, 5}, data).with_dim_names({"batch", "channel", "height", "width"}) + /// rerun::Tensor({8, 6, 3, 5}, data).with_dim_names({"width", "height", "channel", "batch"}) /// ); /// } /// ```