pub fn apply_eager(
op: Arc<dyn ExtensionOp>,
inputs: &[&EagerTensor],
) -> Result<Vec<EagerTensor>>Expand description
Apply an extension op to eager AD tensors.
§Examples
use tenferro_ad::extension::apply_eager;
use tenferro_ad::{EagerRuntime, EagerTensor};
use tenferro_cpu::CpuBackend;
use tenferro_tensor::Tensor;
let ctx = EagerRuntime::with_cpu_backend(CpuBackend::new())?;
let x = EagerTensor::from_tensor_in(
Tensor::from_vec_col_major(vec![1], vec![1.0_f64]).unwrap(),
ctx,
).unwrap();
let _ = &x;
let _apply = apply_eager;§Errors
Returns Error::Validation with InvalidArgument when inputs is empty
or its length differs from the extension’s declared input count. Returns
Error::ContextMismatch when tensors belong to different eager runtimes;
backend, extension, and runtime-state failures retain their typed sources.