Skip to content

Commit

Permalink
remove tensor.h and declare Prod in pattern_utils.h
Browse files Browse the repository at this point in the history
  • Loading branch information
masahi committed Feb 6, 2021
1 parent 9f462d7 commit 9877ddf
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 42 deletions.
4 changes: 0 additions & 4 deletions src/relay/op/tensor/reduce.cc
Original file line number Diff line number Diff line change
Expand Up @@ -475,10 +475,6 @@ Array<te::Tensor> ProdCompute(const Attrs& attrs, const Array<te::Tensor>& input
return ReduceCompute(attrs, inputs, out_type, topi::prod);
}

Expr Prod(Expr data, Array<Integer> axis, bool keepdims, bool exclude) {
return MakeReduce(data, axis, keepdims, exclude, "prod");
}

TVM_REGISTER_GLOBAL("relay.op._make.prod").set_body_typed(Prod);

RELAY_REGISTER_OP("prod")
Expand Down
37 changes: 0 additions & 37 deletions src/relay/op/tensor/tensor.h

This file was deleted.

1 change: 1 addition & 0 deletions src/relay/op/vm/vm.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Expr InvokeTVMOp(Expr func, Expr inputs, Expr outputs);
Expr ShapeFunc(Expr func, Expr inputs, Expr outputs, Array<tvm::Integer> is_input);
Expr ShapeOf(Expr expr);
Expr ReshapeTensor(Expr data, Expr shape, Array<PrimExpr> newshape);

} // namespace relay
} // namespace tvm

Expand Down
1 change: 0 additions & 1 deletion src/relay/transforms/memory_alloc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@

#include "../backend/compile_engine.h"
#include "../op/memory/memory.h"
#include "../op/tensor/tensor.h"
#include "../op/vm/vm.h"
#include "let_list.h"
#include "pattern_utils.h"
Expand Down
4 changes: 4 additions & 0 deletions src/relay/transforms/pattern_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,10 @@ static inline Expr Sum(Expr data, Array<Integer> axis, bool keepdims, bool exclu
return MakeReduce(data, axis, keepdims, exclude, "sum");
}

static inline Expr Prod(Expr data, Array<Integer> axis, bool keepdims, bool exclude) {
return MakeReduce(data, axis, keepdims, exclude, "prod");
}

static inline Expr Reshape(Expr data, Array<Integer> newshape) {
return MakeReshape(data, newshape);
}
Expand Down

0 comments on commit 9877ddf

Please sign in to comment.