Skip to main content

TracedTensordotOps

Trait TracedTensordotOps 

Source
pub trait TracedTensordotOps {
    // Required method
    fn tensordot(
        &self,
        b: &TracedTensor,
        axes: TensorDotAxes<'_>,
    ) -> Result<TracedTensor>;
}
Expand description

Tensordot recorded on traced tensors.

Generated by api_ops! from the einsum registry.

Required Methods§

Source

fn tensordot( &self, b: &TracedTensor, axes: TensorDotAxes<'_>, ) -> Result<TracedTensor>

Contract a with b over the given axis pairs (or the last/first n axes); free axes of a come first.

This operation has no options.

§Layout

Lowered to one dot_general, which reads strided operands in place; an operand that the provider cannot read is packed once into a compact buffer of the same placement and dtype.

§Errors

Returns an error of kind:

  • Validation
  • Unsupported
§Omissions
  • lanes (CpuEngine::with_lanes): tensordot is unsupported in a lane
§Examples
use tenferro_einsum::{TensorDotAxes, TracedTensordotOps};
use tenferro_runtime::TraceContext;

let trace = TraceContext::new();
let a = trace.from_vec_col_major(vec![2, 3], vec![1.0_f64; 6])?;
let b = trace.from_vec_col_major(vec![3, 4], vec![1.0_f64; 12])?;
let c = a.tensordot(&b, TensorDotAxes::Count(1))?;
assert_eq!(c.rank(), 2);

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§