-
Notifications
You must be signed in to change notification settings - Fork 373
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
Refactor: categorize tensor data as either compressed or uncompressed #1684
Conversation
@@ -275,7 +277,11 @@ fn apply_color_map(tensor: &Tensor, annotations: &Arc<Annotations>) -> anyhow::R | |||
let size = [width as _, height as _]; | |||
|
|||
match (depth, &tensor.data, tensor.meaning) { | |||
(1, TensorData::U8(buf), TensorDataMeaning::ClassId) => { | |||
( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This match is a big mess, and my next step is to rewrite it
Oh right, I need to update the Python code too 🤦 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This means you now need to update https://github.com/rerun-io/rerun/blob/main/rerun_py/rerun_sdk/rerun/components/tensor.py to handle this union-of-unions...
I am not really seeing the value-add of this refactor yet, especially in light of the fact that the longer-term goal is to split the component anyways. This seems to adds extra arrow complexity by introducing a union-of-unions on the storage side for the benefit of simplifying some match statements. |
I didn't anticipate the huge pain it would entail to change any of our arrow-touching data types. It's an enormous pain in the ass, and I also get crashes from some bug in
So yeah, I'll just leave it until we split the tensor into components instead. |
Interesting -- seems like your change causes us to start hitting: DataEngineeringLabs/arrow2-convert#86 |
This refactor sub-divides
enum TensorData
into two new enums:This will make it easier and less error-prone to add more compression/encoding schemes to tensors, such as PNG.
In the long term we probably want this split to be done higher up (
Tensor
vsCompressedTensor
). Related:Checklist