Changing return of relay.Function or IRModule?

Ohh, I thought my bad! Thanks a lot. There is only a slight problem.

This is what I get. It adds an additional statement into relay IR ( %3 = add(%x1, %y1):wink: and returns the result.

fn (%x1: Tensor[(1, 1, 1, 20), float32], %y1: Tensor[(1, 1, 1, 20), float32]) {
  %0 = add(%x1, %y1);
  %1 = subtract(%x1, %y1);
  %2 = multiply(%0, %1);
  %3 = add(%x1, %y1);
  (%2, %3)
}

This is ideally, what I’d like to create. @mbrookhart – Is there something that I can do to fix this?

fn (%x1: Tensor[(1, 1, 1, 20), float32], %y1: Tensor[(1, 1, 1, 20), float32]) {
  %0 = add(%x1, %y1);
  %1 = subtract(%x1, %y1);
  %2 = multiply(%0, %1);
  (%2, %0)
}