hzfan commented on a change in pull request #17811: add ffi full_like, binary
ops, benchmark test
URL: https://github.com/apache/incubator-mxnet/pull/17811#discussion_r392036401
##########
File path: src/operator/tensor/init_op.h
##########
@@ -105,6 +105,13 @@ struct FullLikeOpParam : public
dmlc::Parameter<FullLikeOpParam> {
MXNET_ADD_ALL_TYPES_WITH_BOOL
.describe("Target data type.");
}
+ void SetAttrDict(std::unordered_map<std::string, std::string>* dict) {
+ std::ostringstream fill_value_s, dtype_s;
+ fill_value_s << fill_value;
+ dtype_s << dtype;
+ (*dict)["fill_value"] = fill_value_s.str();
+ (*dict)["dtype"] = dtype_s.str();
Review comment:
```
if (dtype.has_value()) {
(*dict)["dtype"] = String2MXNetTypeWithBool(dtype.value());
} else {
(*dict)["dtype"] = dtype_s.str();
}
```
`String2MXNetTypeWithBool` lies in `src/api/operator/op_utils.h`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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