Skip to content

Commit

Permalink
bug fix for IdentityComputeRsp
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-haibin-lin committed Jul 22, 2017
1 parent 1e88958 commit dda7893
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/operator/tensor/elemwise_unary_op.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "../elemwise_op_common.h"
#include "../special_functions-inl.h"
#include "./broadcast_reduce-inl.h"
#include "./init_op.h"

namespace mxnet {
namespace op {
Expand Down Expand Up @@ -91,7 +92,11 @@ void IdentityComputeRsp(const nnvm::NodeAttrs& attrs,
auto &output = outputs[0];
CHECK_NE(req[0], kNullOp) << "kNullOp in IdentityComputeEx not supported yet";
CHECK_NE(req[0], kWriteInplace) << "kWriteInplace in IdentityComputeEx not supported yet";
if (!input.storage_initialized()) return;
if (!input.storage_initialized()) {
NDArray out = output;
FillZerosRspImpl(s, &out);
return;
}
TShape shape = input.aux_shape(rowsparse::kIdx);
output.CheckAndAlloc({shape});
MSHADOW_TYPE_SWITCH(output.dtype(), DType, {
Expand Down

0 comments on commit dda7893

Please sign in to comment.