pub struct TestInput { /* private fields */ }Implementations§
Source§impl TestInput
impl TestInput
Sourcepub fn builder(
client: ComputeClient<TestRuntime>,
shape: impl Into<Shape>,
) -> TestInputBuilder
pub fn builder( client: ComputeClient<TestRuntime>, shape: impl Into<Shape>, ) -> TestInputBuilder
Start a fluent builder for a test input.
Defaults: dtype = f32, stride = RowMajor. Call .dtype(_) /
.stride(_) to override, then a finalizer such as .arange(),
.eye(), .zeros(), .uniform(seed, lo, hi), .bernoulli(seed, p),
or .custom(data) to produce a TestInput ready to generate.
pub fn new( client: ComputeClient<TestRuntime>, shape: impl Into<Shape>, dtype: impl Into<InputDataType>, stride_spec: StrideSpec, data_kind: DataKind, ) -> Self
pub fn generate_with_f32_host_data( self, ) -> (TensorHandle<TestRuntime>, HostData)
pub fn generate_with_bool_host_data( self, ) -> (TensorHandle<TestRuntime>, HostData)
pub fn generate_test_tensor(self) -> TestTensor
pub fn f32_host_data(self) -> HostData
pub fn bool_host_data(self) -> HostData
pub fn generate_without_host_data(self) -> TensorHandle<TestRuntime>
pub fn generate(self) -> TensorHandle<TestRuntime>
Auto Trait Implementations§
impl Freeze for TestInput
impl !RefUnwindSafe for TestInput
impl Send for TestInput
impl Sync for TestInput
impl Unpin for TestInput
impl UnsafeUnpin for TestInput
impl !UnwindSafe for TestInput
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more