try_tenferro_to_burn

Function try_tenferro_to_burn 

Source
pub fn try_tenferro_to_burn<B: Backend<FloatElem = f64>>(
    tensor: Tensor<f64>,
    device: &B::Device,
) -> Result<FloatTensor<B>>
Expand description

Convert a tenferro Tensor<f64> into a Burn backend tensor primitive.

The device parameter specifies which Burn device the resulting tensor should be placed on. For the NdArray backend this is typically NdArrayDevice::Cpu, obtainable via Default::default(). The bridge always materializes a row-major owned buffer at this boundary.

§Current Limitations

This function currently supports only Burn backends whose float element type is f64. Support for other element types will be added in future versions.

§Examples

use burn::backend::NdArray;
use burn::backend::ndarray::NdArrayDevice;
use tenferro_ext_burn::convert::try_tenferro_to_burn;

let tenferro_t: tenferro_tensor::Tensor<f64> = todo!();
let device = NdArrayDevice::Cpu;
let burn_prim = try_tenferro_to_burn::<NdArray<f64>>(tenferro_t, &device).unwrap();