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

create Image and Tensor/Storage from parts #208

Merged
merged 2 commits into from
Jan 1, 2025
Merged

Conversation

edgarriba
Copy link
Member

This pull request includes several important changes to the kornia-image and kornia-tensor crates. The changes introduce new methods for creating images and tensors from raw parts, add corresponding tests, and improve memory safety checks in deallocation.

Needed by: https://github.com/copper-project/copper-rs/pull/193/files

New methods for creating images and tensors from raw parts:

  • crates/kornia-image/src/image.rs: Added the from_raw_parts method to the Image struct, which allows creating an image from raw parts. This method includes safety documentation and argument descriptions.
  • crates/kornia-tensor/src/storage.rs: Added the from_raw_parts method to the TensorStorage struct, enabling the creation of tensor storage from raw parts. This method includes safety documentation.
  • crates/kornia-tensor/src/tensor.rs: Added the from_raw_parts method to the Tensor struct, allowing the creation of a tensor from raw parts. This method includes safety documentation and argument descriptions.

Tests for new methods:

Memory safety improvements:

@edgarriba edgarriba merged commit 2bc0585 into main Jan 1, 2025
12 checks passed
@edgarriba edgarriba deleted the image-from-parts branch January 2, 2025 06:52
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.

1 participant