You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2020/06/04 05:27:04 UTC
[GitHub] [incubator-mxnet] samskalicky commented on a change in pull request #18378: Add backward Type inference to main NN operators
samskalicky commented on a change in pull request #18378:
URL: https://github.com/apache/incubator-mxnet/pull/18378#discussion_r434999872
##########
File path: src/operator/contrib/batch_norm_relu.cc
##########
@@ -84,14 +84,30 @@ static bool BatchNormWithReLUType(const nnvm::NodeAttrs& attrs,
std::vector<int> *in_type, std::vector<int> *out_type) {
using namespace mshadow;
CHECK_GE(in_type->size(), 1U);
- const int dtype = (*in_type)[0];
- CHECK_NE(dtype, -1) << "First input must have specified type";
+ const size_t n_out = 4;
// For float16 input type beta, gamma, mean, and average are stored in float32.
// For other input types, these parameters have the same type as input
// NOTE: This requirement is from cuDNN (v. 4 and 5)
int dtype_param;
- MSHADOW_REAL_TYPE_SWITCH_EX(dtype, DTypeX, AccRealX, {
+ int dtype = (*in_type)[0];
+ if (type_is_none(dtype)) {
+ if (out_type->size() == 0 || type_is_none((*out_type)[0])) {
Review comment:
what does this mean if this logic is true? can you add a comment in the code?
----------------------------------------------------------------
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:
users@infra.apache.org