-
Notifications
You must be signed in to change notification settings - Fork 2
Finalize experimental types
Add a new experimental subdirectory inside tensor, which provides matrix and vector types that are type aliases for existing tensor types.
Add type traits for the experimental types such as is_matrix
, add all functions that existed in ublas::matrix
to new types as free functions. Add examples demonstrating the usage of new experimental types. We can put them in examples/tensor/experimental
.
Also, add unit tests so code coverage doesn't degrade.
Should we allow the matrix types and vector types to be creatable from implied or explicit tensor extents.
Case 1: (Implied) A tensor of extents {1,2,3,1} is convertible into a matrix type if we squeeze the extents (Squeezing means removing extents with value 1). This yields a matrix of extents {2,3}.
Example:
ublas::experimental::dynamic_matrix a<int> = dynamic_tensor<int>({1,2,3,1}); // a's extent is {2,3}
ublas::experimental::static_matrix b<int> = static_tensor<int, 2,3,1,1>{} // b's extent is <2,3>
ublas::experimental::dynamic_matrix c<int> = dynamic_tensor<int>({4,3}); // c's extent is {4,3}
ublas::experimental::static_matrix d<int> = static_tensor<int, 2,3>{} // b's extent is <2,3>
Benefits:
- Tensor contractions results can be directly assigned to matrices and vectors.
- More flexible and limited restriction on matrix types
Case 2: (Explicit) Matrix constructor restricts the tensor to be rank 2. If the above extent tensor is to be assigned to a matrix type, the extents must be squeezed by the user.
Example:
ublas::experimental::dynamic_matrix a<int> = squeeze(dynamic_tensor<int>({1,2,3,1})); // a's extent is {2,3}
ublas::experimental::static_matrix b<int> = squeeze(static_tensor<int, 2,3,1,1>{}) // b's extent is <2,3>
ublas::experimental::dynamic_matrix c<int> = dynamic_tensor<int>({4,3}); // c's extent is {4,3}
ublas::experimental::static_matrix d<int> = static_tensor<int, 2,3>{} // b's extent is <2,3>
I thank our mentor Cem for his constant support and help in achieving our goals. We always find him helpful and he was always easy to reach for help or discussion regarding the work. We would also like to thank Google for the Google Summer of Code Programme, without which all these wouldn't be possible. Lastly, we express our gratitude to our parents for helping and providing us with all resources to carrying out our work nicely from our homes.
- Project Proposal
- Milestones and Tasks
- Implementation
- cpp20
- github-actions
- features/tidy
- features/format
- features/cmake
- Documentation
- Pull Requests
- Future Work