Kina.ai

Example

invalid_reduce_mean_ad.kina

Expected rejection

This program is intentionally invalid. The compiler should reject its type or shape.

Source
let f = fn(x: tensor<F32, [2, 3], @host>) -> tensor<F32, [2, 1], @host> {
  let y = x.reduce_keep(op=mean, axis=1) in
  y
} in
let x = tensor<F32, [2, 3], @host> in
handle f(x) with reverseMode