eric-haibin-lin commented on a change in pull request #7947: Refactor infer
storage function for sparse operators.
URL: https://github.com/apache/incubator-mxnet/pull/7947#discussion_r141460286
##########
File path: src/operator/operator_common.h
##########
@@ -253,6 +300,48 @@ inline bool type_assign(int *y, const int& x) {
}
#endif
+/*! \brief assign stype to target_stype, if successful,
+ * assign dispatch_mode to target_dispatch
+ */
+inline bool storage_type_assign(int* stype,
+ const NDArrayStorageType target_stype,
+ DispatchMode* dispatch,
+ const DispatchMode target_dispatch) {
Review comment:
Usually you'll check whether the stype_assign is successful or not before
assigning dispatch mode. If you want to separate the two, it makes all
infer_storage function very lengthy. Such logic is common and I think we should
use one function for convenience. I still think the original name
`dispatch_on_storage` is better
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services