Closed Oufattole closed 2 months ago
This update enhances the load_slice
method in the JointNestedRaggedTensorDict
class by introducing a new optional parameter, split_last
. This parameter allows users to choose whether to split or flatten the last level of tensor data when loading slices. The change improves the flexibility of tensor processing, catering to varying user requirements for data structure.
Files | Change Summary |
---|---|
src/nested_ragged_tensors/ragged_numpy.py |
Modified the load_slice method in JointNestedRaggedTensorDict to include a new optional parameter, split_last , which adjusts how tensor data is processed. |
sequenceDiagram
participant User
participant JointNestedRaggedTensorDict
participant TensorProcessor
User->>JointNestedRaggedTensorDict: load_slice(fp, idx, split_last)
JointNestedRaggedTensorDict->>TensorProcessor: Process data with split_last
alt split_last = true
TensorProcessor-->>JointNestedRaggedTensorDict: Split last level
else split_last = false
TensorProcessor-->>JointNestedRaggedTensorDict: Flatten last level
end
JointNestedRaggedTensorDict-->>User: Return loaded tensors
Hop along, my fuzzy friend,
With tensors that twist and bend!
A slice to load, the choice is clear,
To split or flatten, bring us cheer!
In data's dance, we frolic and play,
A hop, a leap, in the tensor ballet! 🐇✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Summary by CodeRabbit
split_last
, in the tensor loading functionality, providing enhanced control over how the last level of data is processed.split_last
parameter.