license import { ENGINE } from '../engine' ; import { Einsum , EinsumAttrs } from '../kernel_names' ; import { NamedAttrMap } from '../kernel_registry' ; import { Tensor } from '../tensor' ; import { NamedTensorMap } from '../tensor_types' ; import { convertToTensor } from '../tensor_util_env' ; import { op } from './operation' ; param equation param tensors returns doc export function einsum_ ( equation , ... tensors ) { const $tensors = tensors . map ( ( t , i ) => convertToTensor ( t , `tensors${ i }` , 'einsum' ) ) ; const attrs = { equation } ; return ENGINE . runKernel ( Einsum , $tensors as { } as NamedTensorMap , attrs as { } as NamedAttrMap ) ; } export const einsum = op ( { einsum_ } ) ;