Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
Experiment fixing SliceAxisGrad_
Browse files Browse the repository at this point in the history
  • Loading branch information
zoeygxy committed Aug 23, 2019
1 parent 1e21b1a commit a1b6ec5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/operator/tensor/matrix_op-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -1266,6 +1266,9 @@ void SliceAxisGrad_(const nnvm::NodeAttrs& attrs,
const std::vector<TBlob>& inputs,
const std::vector<OpReqType>& req,
const std::vector<TBlob>& outputs) {
if (outputs[0].shape_.Size() == 0) {
return;
}
const SliceAxisParam& param = nnvm::get<SliceAxisParam>(attrs.parsed);
using namespace mshadow::op;
using namespace mshadow::expr;
Expand All @@ -1274,7 +1277,6 @@ void SliceAxisGrad_(const nnvm::NodeAttrs& attrs,
index_t begin, end;
GetSliceAxisParams(param, outputs[0].shape_, &axis, &begin, &end);
int ndim = outputs[0].shape_.ndim();

if (axis + 1 == ndim) {
MSHADOW_TYPE_SWITCH(outputs[0].type_flag_, DType, {
mshadow::Tensor<xpu, 2, DType> ograd =
Expand Down

0 comments on commit a1b6ec5

Please sign in to comment.