24 #ifndef TVM_TOPI_X86_BNN_H_ 25 #define TVM_TOPI_X86_BNN_H_ 53 auto _schedule = [&](
const Tensor& out) {
57 std::function<void(Operation)> traverse;
59 if (op->tag ==
"binarize_pack") {
60 _schedule(op.output(0));
62 LOG(ERROR) <<
"Unsupported operator " << op->tag;
66 traverse(outs[0]->op);
91 if (detail::contains(s->outputs, C->op)) {
94 out = outs[0]->op.output(0);
102 std::function<void(Operation)> traverse;
106 if (!detail::contains(s->outputs, op)) {
107 s[op].compute_inline();
109 for (
auto tensor : op->InputTensors()) {
110 if (tensor->op->InputTensors().size() > 0) {
111 traverse(tensor->op);
114 }
else if (op->tag ==
"binary_dense") {
115 auto output = op.output(0);
116 auto data = op->InputTensors()[0];
117 auto weight = op->InputTensors()[1];
118 _schedule(data, weight, output);
120 LOG(ERROR) <<
"Unsupported operator " << op->tag;
124 traverse(outs[0]->op);
131 #endif // TVM_TOPI_X86_BNN_H_ Global schedule container For operations and all the operations they depend on. The schedule per Oper...
Definition: schedule.h:318
Schedule create_schedule(Array< Operation > ops)
Create a schedule for array of ops(and their dependencies).
Definition: schedule.h:695
runtime implementation for LibTorch/TorchScript.
Definition: analyzer.h:36
Tensor expression language DSL.
Definition: extracted_task.h:33
Operation that produces tensors.
Definition: tensor.h:47
Iteration Variable, represents an iteration over an integer interval.
Definition: var.h:308
Schedule schedule_binarize_pack(const Target &target, const Array< Tensor > &outs)
Create a generic schedule for binarize_pack.
Definition: bnn.h:46
void push_back(const T &item)
push a new item to the back of the list
Definition: array.h:457
Array, container representing a contiguous sequence of ObjectRefs.
Definition: array.h:289
A Compute op that compute a tensor on certain domain.
Definition: operation.h:226
Array< IterVar > axis
IterVar on each axis.
Definition: operation.h:207
Managed reference class to TargetNode.
Definition: target.h:183
Tensor structure representing a possible input, or intermediate computation result.
Definition: tensor.h:102
Operation node can generate one or multiple Tensors.
bool is_broadcast(std::string tag)
Definition: tags.h:47
Schedule schedule_binary_dense(const Target &target, const Array< Tensor > &outs)
Create a generic schedule for binary_dense.
Definition: bnn.h:78
const ObjectType * as() const
Try to downcast the internal Object to a raw pointer of a corresponding type.
Definition: object.h:865
Array< IterVar > reduce_axis
IterVar on each reduction axis, if the body is a Reduce.
Definition: operation.h:209
Generic function that can be specialzied on a per target basis.