ort-candle 0.4.1+0.11.0

ort + candle = 🦀 - An alternative backend for ort, powered by candle.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use candle_core::DType;

pub struct TypeInfo {
	pub dtype: DType,
	pub shape: Vec<i64>
}

impl TypeInfo {
	pub fn new_sys(dtype: DType, shape: Vec<i64>) -> *mut ort_sys::OrtTypeInfo {
		(Box::leak(Box::new(Self { dtype, shape })) as *mut TypeInfo).cast()
	}

	pub unsafe fn consume_sys(ptr: *mut ort_sys::OrtTypeInfo) -> Box<TypeInfo> {
		Box::from_raw(ptr.cast::<TypeInfo>())
	}
}