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

Commit

Permalink
change position
Browse files Browse the repository at this point in the history
  • Loading branch information
Yiyan66 committed Dec 17, 2019
1 parent 5c58382 commit 84a6f46
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/operator/numpy/np_broadcast_reduce_op.h
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,7 @@ void NumpyMedianForward(const nnvm::NodeAttrs& attrs,

Stream<xpu> *s = ctx.get_stream<xpu>();

auto &param = nnvm::get<NumpyMedianParam>(attrs.parsed);
NumpyMedianParam param = nnvm::get<NumpyMedianParam>(attrs.parsed);
const TBlob& a = inputs[0];
const TBlob& r = outputs[0];

Expand Down Expand Up @@ -979,6 +979,12 @@ void NumpyMedianForward(const nnvm::NodeAttrs& attrs,
t_shape_ex[i] = a.shape_[axes[i-small.ndim()]];
}

TopKParam topk_param;
topk_param.axis = dmlc::optional<int>(-1);
topk_param.is_ascend = true;
topk_param.k = 0;
topk_param.ret_typ = topk_enum::kReturnValue;

MSHADOW_TYPE_SWITCH(a.type_flag_, DType, {
using namespace mshadow::expr;
Tensor<xpu, 1, char> workspace;
Expand Down Expand Up @@ -1033,12 +1039,6 @@ void NumpyMedianForward(const nnvm::NodeAttrs& attrs,

TransposeImpl<xpu>(ctx.run_ctx, a, a_trans, t_axes);

TopKParam topk_param;
topk_param.axis = dmlc::optional<int>(-1);
topk_param.is_ascend = true;
topk_param.k = 0;
topk_param.ret_typ = topk_enum::kReturnValue;

TBlob a_sort = TBlob(sort_ptr, t_shape, xpu::kDevMask);
TBlob a_idx = TBlob(idx_ptr, t_shape, xpu::kDevMask);

Expand Down

0 comments on commit 84a6f46

Please sign in to comment.