pub trait RunnerClient:
Clone
+ Send
+ Sync
+ Sized {
type Device: DeviceOps;
// Required methods
fn register(&self, op: OperationIr);
fn read_tensor(&self, tensor: TensorIr) -> DynFut<TensorData>;
fn sync(&self);
fn register_tensor_data(&self, data: TensorData) -> RouterTensor<Self>;
fn register_empty_tensor(
&self,
shape: Vec<usize>,
dtype: DType,
) -> RouterTensor<Self>;
fn register_float_tensor(
&self,
shape: Vec<usize>,
dtype: FloatDType,
) -> RouterTensor<Self>;
fn device(&self) -> Self::Device;
fn seed(&self, seed: u64);
}
Expand description
Define how to interact with the runner.
Required Associated Types§
Required Methods§
Sourcefn register(&self, op: OperationIr)
fn register(&self, op: OperationIr)
Register a new tensor operation to be executed by the (runner) server.
Sourcefn read_tensor(&self, tensor: TensorIr) -> DynFut<TensorData>
fn read_tensor(&self, tensor: TensorIr) -> DynFut<TensorData>
Read the values contained by a tensor.
Sourcefn register_tensor_data(&self, data: TensorData) -> RouterTensor<Self>
fn register_tensor_data(&self, data: TensorData) -> RouterTensor<Self>
Create a new RouterTensor from the tensor data.
Sourcefn register_empty_tensor(
&self,
shape: Vec<usize>,
dtype: DType,
) -> RouterTensor<Self>
fn register_empty_tensor( &self, shape: Vec<usize>, dtype: DType, ) -> RouterTensor<Self>
Create a new RouterTensor with no resources associated.
Sourcefn register_float_tensor(
&self,
shape: Vec<usize>,
dtype: FloatDType,
) -> RouterTensor<Self>
fn register_float_tensor( &self, shape: Vec<usize>, dtype: FloatDType, ) -> RouterTensor<Self>
Create a new float RouterTensor with no resources associated.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.