-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[core] Tensor::data member preserve constness of tensor #29594
base: master
Are you sure you want to change the base?
[core] Tensor::data member preserve constness of tensor #29594
Conversation
Signed-off-by: Raasz, Pawel <pawel.raasz@intel.com>
Signed-off-by: Raasz, Pawel <pawel.raasz@intel.com>
Signed-off-by: Raasz, Pawel <pawel.raasz@intel.com>
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.
Looks like we break source compatibility with this change?
Signed-off-by: Raasz, Pawel <pawel.raasz@intel.com>
The compilation errors will points where cast of tensor data pointer is done wrong (programing errors: missing const) from this perspective it will break compatibility. To avoid compile errors with current data() member there is a need to introduce new member or overload data with some tag and mark current data() as deprecated or it will work as new implementation of pointer cast, but still there will be get non-const pointer to const tensors. |
@@ -96,7 +96,7 @@ bool Transpose::evaluate(TensorVector& outputs, const TensorVector& inputs) cons | |||
}; | |||
|
|||
auto out_ptr = int4_iterator(static_cast<uint8_t*>(out.data())); | |||
auto in_ptr = int4_iterator(static_cast<uint8_t*>(arg.data())); | |||
auto in_ptr = int4_iterator(static_cast<uint8_t*>(const_cast<void*>(arg.data()))); |
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.
maybe add a comment to describe that data will not be changed here
Signed-off-by: Raasz, Pawel <pawel.raasz@intel.com>
Signed-off-by: Raasz, Pawel <pawel.raasz@intel.com>
Details:
Blocked by:
Tickets: