pub struct SparseTensorBuilder<State>(/* private fields */);Expand description
Builder for serializing an instance of the SparseTensor type.
Can be created using the SparseTensor::builder method.
Implementations§
Source§impl SparseTensorBuilder<()>
impl SparseTensorBuilder<()>
Sourcepub fn type_<T0>(self, value: T0) -> SparseTensorBuilder<(T0,)>where
T0: WriteAsUnion<Type>,
pub fn type_<T0>(self, value: T0) -> SparseTensorBuilder<(T0,)>where
T0: WriteAsUnion<Type>,
Setter for the type field.
Source§impl<T0> SparseTensorBuilder<(T0,)>
impl<T0> SparseTensorBuilder<(T0,)>
Sourcepub fn shape<T1>(self, value: T1) -> SparseTensorBuilder<(T0, T1)>
pub fn shape<T1>(self, value: T1) -> SparseTensorBuilder<(T0, T1)>
Setter for the shape field.
Source§impl<T0, T1> SparseTensorBuilder<(T0, T1)>
impl<T0, T1> SparseTensorBuilder<(T0, T1)>
Sourcepub fn non_zero_length<T2>(self, value: T2) -> SparseTensorBuilder<(T0, T1, T2)>
pub fn non_zero_length<T2>(self, value: T2) -> SparseTensorBuilder<(T0, T1, T2)>
Setter for the non_zero_length field.
Sourcepub fn non_zero_length_as_default(
self,
) -> SparseTensorBuilder<(T0, T1, DefaultValue)>
pub fn non_zero_length_as_default( self, ) -> SparseTensorBuilder<(T0, T1, DefaultValue)>
Sets the non_zero_length field to the default value.
Source§impl<T0, T1, T2> SparseTensorBuilder<(T0, T1, T2)>
impl<T0, T1, T2> SparseTensorBuilder<(T0, T1, T2)>
Sourcepub fn sparse_index<T3>(
self,
value: T3,
) -> SparseTensorBuilder<(T0, T1, T2, T3)>where
T3: WriteAsUnion<SparseTensorIndex>,
pub fn sparse_index<T3>(
self,
value: T3,
) -> SparseTensorBuilder<(T0, T1, T2, T3)>where
T3: WriteAsUnion<SparseTensorIndex>,
Setter for the sparseIndex field.
Source§impl<T0, T1, T2, T3> SparseTensorBuilder<(T0, T1, T2, T3)>
impl<T0, T1, T2, T3> SparseTensorBuilder<(T0, T1, T2, T3)>
Sourcepub fn data<T4>(self, value: T4) -> SparseTensorBuilder<(T0, T1, T2, T3, T4)>
pub fn data<T4>(self, value: T4) -> SparseTensorBuilder<(T0, T1, T2, T3, T4)>
Setter for the data field.
Source§impl<T0, T1, T2, T3, T4> SparseTensorBuilder<(T0, T1, T2, T3, T4)>
impl<T0, T1, T2, T3, T4> SparseTensorBuilder<(T0, T1, T2, T3, T4)>
Sourcepub fn finish(self, builder: &mut Builder) -> Offset<SparseTensor>where
Self: WriteAsOffset<SparseTensor>,
pub fn finish(self, builder: &mut Builder) -> Offset<SparseTensor>where
Self: WriteAsOffset<SparseTensor>,
Finish writing the builder to get an Offset to a serialized SparseTensor.
Trait Implementations§
Source§impl<State: Debug> Debug for SparseTensorBuilder<State>
impl<State: Debug> Debug for SparseTensorBuilder<State>
impl<T0: WriteAsUnion<Type>, T1: WriteAs<Offset<[Offset<TensorDim>]>>, T2: WriteAsDefault<i64, i64>, T3: WriteAsUnion<SparseTensorIndex>, T4: WriteAs<Buffer>> WriteAs<Offset<SparseTensor>> for SparseTensorBuilder<(T0, T1, T2, T3, T4)>
impl<T0: WriteAsUnion<Type>, T1: WriteAs<Offset<[Offset<TensorDim>]>>, T2: WriteAsDefault<i64, i64>, T3: WriteAsUnion<SparseTensorIndex>, T4: WriteAs<Buffer>> WriteAsOffset<SparseTensor> for SparseTensorBuilder<(T0, T1, T2, T3, T4)>
impl<T0: WriteAsUnion<Type>, T1: WriteAs<Offset<[Offset<TensorDim>]>>, T2: WriteAsDefault<i64, i64>, T3: WriteAsUnion<SparseTensorIndex>, T4: WriteAs<Buffer>> WriteAsOptional<Offset<SparseTensor>> for SparseTensorBuilder<(T0, T1, T2, T3, T4)>
Auto Trait Implementations§
impl<State> Freeze for SparseTensorBuilder<State>where
State: Freeze,
impl<State> RefUnwindSafe for SparseTensorBuilder<State>where
State: RefUnwindSafe,
impl<State> Send for SparseTensorBuilder<State>where
State: Send,
impl<State> Sync for SparseTensorBuilder<State>where
State: Sync,
impl<State> Unpin for SparseTensorBuilder<State>where
State: Unpin,
impl<State> UnwindSafe for SparseTensorBuilder<State>where
State: UnwindSafe,
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more