Skip to content

Commit

Permalink
fix(mgb/opr): add layout constraint on the input of Cumsum
Browse files Browse the repository at this point in the history
GitOrigin-RevId: d2d108e2786806aa3f4c44ebfc0bf5f094cdab42
  • Loading branch information
megvii-mge committed Apr 8, 2021
1 parent 0d16539 commit bab0caa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/opr/impl/misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ void Cumsum::scn_do_execute() {
intl::get_megdnn_workspace_from_var(output().back()));
}

void Cumsum::add_input_layout_constraint() {
input(0)->add_layout_constraint_contiguous();
}

void Cumsum::init_output_static_infer_desc() {
using namespace cg::static_infer;
auto infer_shape = [](TensorShape& dest, const InpVal& iv) {
Expand Down
1 change: 1 addition & 0 deletions src/opr/include/megbrain/opr/misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ MGB_DEFINE_OPR_CLASS(ArgsortBackward,
//! cumulative sum along given axis
MGB_DEFINE_OPR_CLASS(Cumsum, cg::SingleCNOperatorNodeBaseT<
mixin::MegDNNOprHolderImpl<megdnn::Cumsum>>) // {
void add_input_layout_constraint() override;

public:
Cumsum(VarNode *src, const Param &param, const OperatorNodeConfig &config);
Expand Down

0 comments on commit bab0caa

Please sign in to comment.