auto dst_obj = copy->into();
auto dst_bag = dst_obj->bag();
+ // Output calculation should not be folded
+ // TODO Reduce code duplication of this kind
+ if (dst_bag->isOutput())
+ {
+ return;
+ }
+
// NOTE d->allocated(bag) returns true if bag has corresponding initial
// values (e.g. convolution kernel)
assert(d->allocated(src_bag));
auto dst_obj = eval->out();
auto dst_bag = dst_obj->bag();
+ // Output calculation should not be folded
+ // TODO Reduce code duplication of this kind
+ if (dst_bag->isOutput())
+ {
+ return;
+ }
+
assert(d->allocated(src_bag));
assert(!d->allocated(dst_bag));
auto dst_obj = eval->out();
auto dst_bag = dst_obj->bag();
+ // Output calculation should not be folded
+ // TODO Reduce code duplication of this kind
+ if (dst_bag->isOutput())
+ {
+ return;
+ }
+
// The other bag is non-constant
if (!d->allocated(lhs_bag) || !d->allocated(rhs_bag))
{
--- /dev/null
+operand {
+ name: "ifm0"
+ type: FLOAT32
+ shape { dim: 1 dim: 4 dim: 4 dim: 3 }
+ filler { tag: "constant" arg: "0.1" }
+}
+operand {
+ name: "ifm1"
+ type: FLOAT32
+ shape { dim: 1 dim: 4 dim: 4 dim: 3 }
+ filler { tag: "constant" arg: "0.1" }
+}
+operand {
+ name: "ofm"
+ type: FLOAT32
+ shape { dim: 1 dim: 4 dim: 4 dim: 3 }
+}
+operation {
+ type: "Div"
+ input: "ifm0"
+ input: "ifm1"
+ output: "ofm"
+ div_options {
+ activation: NONE
+ }
+}
+output: "ofm"