-
Notifications
You must be signed in to change notification settings - Fork 73
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
[TensorV2] Add utility member functions to TensorV2 class @open sesame 03/07 10:42 #2489
Conversation
📝 TAOS-CI Version: 1.5.20200925. Thank you for submitting PR #2489. Please a submit 1commit/1PR (one commit per one PR) policy to get comments quickly from reviewers. Your PR must pass all verificiation processes of cibot before starting a review process from reviewers. If you are new member to join this project, please read manuals in documentation folder and wiki page. In order to monitor a progress status of your PR in more detail, visit http://ci.nnstreamer.ai/. |
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.
@djeong20, 💯 All CI checkers are successfully verified. Thanks.
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.
@djeong20, 💯 All CI checkers are successfully verified. Thanks.
1a667ba
to
c657fe4
Compare
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.
@djeong20, 💯 All CI checkers are successfully verified. Thanks.
c657fe4
to
c88b850
Compare
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.
@djeong20, 💯 All CI checkers are successfully verified. Thanks.
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.
LGTM
* @param[in] d tensor dim | ||
* @param[in] offset offset to be used from current | ||
* @return Tensor object | ||
* @throws std::invalid_argument if buf is null |
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.
Adding a note that the buffer is not owned by the mapped tensor would be better.
the user may be confused.
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.
applied!
std::default_delete<MemoryData>()); | ||
offset = offset; | ||
} | ||
|
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.
Could you explain a little bit more about this function's purpose? Just curious because I have not seen this in, let's say, TensorV1
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 is simply a helper function to set certain TensorBase variables in the Tensor class.
since Map() is a static function, the possible way to set TensorBase variables would be using a Tensor public function.
therefore, the SetTensorVar() function has been newly added.
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.
LGTM
This pull request adds several new utility member functions to the TensorV2 class, enabling users to perform various tasks with their tensors more easily and efficiently. These include saving and loading tensors, updating batches, getting argmax and max absolute values, and more. The implementation is based on the current Tensor class and aims to improve the overall usability and flexibility of the TensorV2 class. **Changes proposed in this PR:** - Added save() and read() methods to allow saving and loading of saved tensor data. - Added Map() method to create a new Tensor object from a buffer. - Added argmax() and max_abs() methods to retrieve the indices of max value by batch and the value of the maximum absolute element in a tensor. - Added updateBatch() to update tensor batch size. **Self-evaluation:** 1. Build test: [X]Passed [ ]Failed [ ]Skipped 2. Run test: [X]Passed [ ]Failed [ ]Skipped Signed-off-by: Donghyeon Jeong <dhyeon.jeong@samsung.com>
c88b850
to
8611c3d
Compare
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.
@djeong20, 💯 All CI checkers are successfully verified. Thanks.
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.
LGTM
This pull request adds several new utility member functions to the TensorV2 class, enabling users to perform various tasks with their tensors more easily and efficiently.
These include saving and loading tensors, updating batches, getting argmax and max absolute values, and more.
The implementation is based on the current Tensor class and aims to improve the overall usability and flexibility of the TensorV2 class.
Changes proposed in this PR:
save()
andread()
methods to allow saving and loading of saved tensor data.Map()
method to create a new Tensor object from a buffer.argmax()
andmax_abs()
methods to retrieve the indices of max value by batch and the value of the maximum absolute element in a tensor.updateBatch()
to update tensor batch size.Self-evaluation: