Example
invalid_reverse_mode_return.kina
Expected rejection
This program is intentionally invalid. The compiler should reject its type or shape.
let f = fn(x: tensor<F32, [2, 2], @host>) -> tensor<F32, [2, 2], @host> {
let y = -x in
y
} in
let ad = fn(x: tensor<F32, [2, 2], @host>) -> tensor<F32, [2, 2], @host> {
handle f(x) with reverseMode
} in
let x = tensor<F32, [2, 2], @host> in
ad(x)