Struct tc_tensor::BlockListFile
source · [−]pub struct BlockListFile<FD, FS, D, T> { /* private fields */ }
Expand description
A wrapper around a DenseTensor
File
Implementations
sourceimpl<FD, FS, D, T> BlockListFile<FD, FS, D, T> where
FD: File<Array>,
FS: File<Node>,
D: Dir,
T: Transaction<D>,
impl<FD, FS, D, T> BlockListFile<FD, FS, D, T> where
FD: File<Array>,
FS: File<Node>,
D: Dir,
T: Transaction<D>,
sourcepub async fn constant(
file: FD,
txn_id: TxnId,
shape: Shape,
value: Number
) -> TCResult<Self>
pub async fn constant(
file: FD,
txn_id: TxnId,
shape: Shape,
value: Number
) -> TCResult<Self>
Construct a new BlockListFile
with the given Shape
, filled with the given value
.
sourcepub async fn random_normal(
file: FD,
txn_id: TxnId,
shape: Shape,
dtype: FloatType,
mean: Float,
std: Float
) -> TCResult<Self>
pub async fn random_normal(
file: FD,
txn_id: TxnId,
shape: Shape,
dtype: FloatType,
mean: Float,
std: Float
) -> TCResult<Self>
Construct a new BlockListFile
with the given Shape
, with a random normal distribution.
sourcepub async fn random_uniform(
file: FD,
txn_id: TxnId,
shape: Shape,
dtype: FloatType
) -> TCResult<Self>
pub async fn random_uniform(
file: FD,
txn_id: TxnId,
shape: Shape,
dtype: FloatType
) -> TCResult<Self>
Construct a new BlockListFile
with the given Shape
, with a random normal distribution.
sourcepub async fn from_blocks<S: Stream<Item = TCResult<Array>> + Send + Unpin>(
file: FD,
txn_id: TxnId,
shape: Option<Shape>,
dtype: NumberType,
blocks: S
) -> TCResult<Self>
pub async fn from_blocks<S: Stream<Item = TCResult<Array>> + Send + Unpin>(
file: FD,
txn_id: TxnId,
shape: Option<Shape>,
dtype: NumberType,
blocks: S
) -> TCResult<Self>
Construct a new BlockListFile
from the given Stream
of Array
blocks.
sourcepub async fn from_values<S: Stream<Item = TCResult<Number>> + Send + Unpin>(
file: FD,
txn_id: TxnId,
shape: Shape,
dtype: NumberType,
values: S
) -> TCResult<Self>
pub async fn from_values<S: Stream<Item = TCResult<Number>> + Send + Unpin>(
file: FD,
txn_id: TxnId,
shape: Shape,
dtype: NumberType,
values: S
) -> TCResult<Self>
Construct a new BlockListFile
from the given Stream
of elements.
sourcepub async fn range(
file: FD,
txn_id: TxnId,
shape: Shape,
start: Number,
stop: Number
) -> TCResult<Self>
pub async fn range(
file: FD,
txn_id: TxnId,
shape: Shape,
start: Number,
stop: Number
) -> TCResult<Self>
Construct a new BlockListFile
of elements evenly distributed between start
and stop
.
sourcepub fn into_stream(
self,
txn_id: TxnId
) -> impl Stream<Item = TCResult<Array>> + Unpin
pub fn into_stream(
self,
txn_id: TxnId
) -> impl Stream<Item = TCResult<Array>> + Unpin
Consume this BlockListFile
handle and return a Stream
of Array
blocks.
sourcepub async fn merge_sort(&self, txn_id: TxnId) -> TCResult<()>
pub async fn merge_sort(&self, txn_id: TxnId) -> TCResult<()>
Sort the elements in this BlockListFile
.
Trait Implementations
sourceimpl<FD: Clone, FS: Clone, D: Clone, T: Clone> Clone for BlockListFile<FD, FS, D, T>
impl<FD: Clone, FS: Clone, D: Clone, T: Clone> Clone for BlockListFile<FD, FS, D, T>
sourcefn clone(&self) -> BlockListFile<FD, FS, D, T>
fn clone(&self) -> BlockListFile<FD, FS, D, T>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<FD, FS, D, T, B> CopyFrom<D, B> for BlockListFile<FD, FS, D, T> where
FD: File<Array>,
FS: File<Node>,
D: Dir,
T: Transaction<D>,
B: DenseAccess<FD, FS, D, T>,
impl<FD, FS, D, T, B> CopyFrom<D, B> for BlockListFile<FD, FS, D, T> where
FD: File<Array>,
FS: File<Node>,
D: Dir,
T: Transaction<D>,
B: DenseAccess<FD, FS, D, T>,
sourceimpl<FD, FS, D, T> DenseAccess<FD, FS, D, T> for BlockListFile<FD, FS, D, T> where
D: Dir,
T: Transaction<D>,
FD: File<Array>,
FS: File<Node>,
D::File: AsType<FD> + AsType<FS>,
D::FileClass: From<TensorType>,
impl<FD, FS, D, T> DenseAccess<FD, FS, D, T> for BlockListFile<FD, FS, D, T> where
D: Dir,
T: Transaction<D>,
FD: File<Array>,
FS: File<Node>,
D::File: AsType<FD> + AsType<FS>,
D::FileClass: From<TensorType>,
type Slice = BlockListFileSlice<FD, FS, D, T>
type Slice = BlockListFileSlice<FD, FS, D, T>
The type returned by slice
type Transpose = BlockListTranspose<FD, FS, D, T, BlockListFile<FD, FS, D, T>>
type Transpose = BlockListTranspose<FD, FS, D, T, BlockListFile<FD, FS, D, T>>
The type returned by transpose
sourcefn accessor(self) -> DenseAccessor<FD, FS, D, T>
fn accessor(self) -> DenseAccessor<FD, FS, D, T>
Return a DenseAccessor
enum which contains this accessor.
sourcefn block_stream<'a>(
self,
txn: T
) -> TCBoxTryFuture<'a, TCBoxTryStream<'a, Array>>
fn block_stream<'a>(
self,
txn: T
) -> TCBoxTryFuture<'a, TCBoxTryStream<'a, Array>>
Return a stream of the Array
s which this DenseTensor
comprises.
sourcefn transpose(self, permutation: Option<Vec<usize>>) -> TCResult<Self::Transpose>
fn transpose(self, permutation: Option<Vec<usize>>) -> TCResult<Self::Transpose>
Return a transpose of this DenseTensor
.
sourcefn read_values<'async_trait>(
self,
txn: Self::Txn,
coords: Coords
) -> Pin<Box<dyn Future<Output = TCResult<Array>> + Send + 'async_trait>> where
Self: 'async_trait,
fn read_values<'async_trait>(
self,
txn: Self::Txn,
coords: Coords
) -> Pin<Box<dyn Future<Output = TCResult<Array>> + Send + 'async_trait>> where
Self: 'async_trait,
Return an Array with the values at the given coordinates.
sourcefn value_stream<'a>(
self,
txn: Self::Txn
) -> TCBoxTryFuture<'a, TCBoxTryStream<'a, Number>>
fn value_stream<'a>(
self,
txn: Self::Txn
) -> TCBoxTryFuture<'a, TCBoxTryStream<'a, Number>>
Return a stream of the elements of this DenseTensor
.
sourceimpl<FD, FS, D, T> DenseWrite<FD, FS, D, T> for BlockListFile<FD, FS, D, T> where
D: Dir,
T: Transaction<D>,
FD: File<Array>,
FS: File<Node>,
D::File: AsType<FD> + AsType<FS>,
D::FileClass: From<TensorType>,
impl<FD, FS, D, T> DenseWrite<FD, FS, D, T> for BlockListFile<FD, FS, D, T> where
D: Dir,
T: Transaction<D>,
FD: File<Array>,
FS: File<Node>,
D::File: AsType<FD> + AsType<FS>,
D::FileClass: From<TensorType>,
sourcefn write<'life0, 'async_trait, B>(
&'life0 self,
txn: Self::Txn,
bounds: Bounds,
value: B
) -> Pin<Box<dyn Future<Output = TCResult<()>> + Send + 'async_trait>> where
B: 'async_trait + DenseAccess<FD, FS, D, T>,
'life0: 'async_trait,
Self: 'async_trait,
fn write<'life0, 'async_trait, B>(
&'life0 self,
txn: Self::Txn,
bounds: Bounds,
value: B
) -> Pin<Box<dyn Future<Output = TCResult<()>> + Send + 'async_trait>> where
B: 'async_trait + DenseAccess<FD, FS, D, T>,
'life0: 'async_trait,
Self: 'async_trait,
Overwrite this accessor’s contents with those of the given accessor.
sourceimpl<FD, FS, D, T> Display for BlockListFile<FD, FS, D, T>
impl<FD, FS, D, T> Display for BlockListFile<FD, FS, D, T>
sourceimpl<FD, FS, D, T> From<BlockListFile<FD, FS, D, T>> for DenseAccessor<FD, FS, D, T> where
FD: File<Array>,
FS: File<Node>,
D: Dir,
T: Transaction<D>,
impl<FD, FS, D, T> From<BlockListFile<FD, FS, D, T>> for DenseAccessor<FD, FS, D, T> where
FD: File<Array>,
FS: File<Node>,
D: Dir,
T: Transaction<D>,
sourcefn from(file: BlockListFile<FD, FS, D, T>) -> Self
fn from(file: BlockListFile<FD, FS, D, T>) -> Self
Converts to this type from the input type.
sourceimpl<FD, FS, D, T> FromStream for BlockListFile<FD, FS, D, T> where
FD: File<Array>,
FS: Send,
D: Send,
T: Send,
impl<FD, FS, D, T> FromStream for BlockListFile<FD, FS, D, T> where
FD: File<Array>,
FS: Send,
D: Send,
T: Send,
sourceimpl<FD, FS, D, T> Persist<D> for BlockListFile<FD, FS, D, T> where
FD: File<Array>,
FS: File<Node>,
D: Dir,
T: Transaction<D>,
impl<FD, FS, D, T> Persist<D> for BlockListFile<FD, FS, D, T> where
FD: File<Array>,
FS: File<Node>,
D: Dir,
T: Transaction<D>,
sourceimpl<FD, FS, D, T> Restore<D> for BlockListFile<FD, FS, D, T> where
FD: File<Array>,
FS: File<Node>,
D: Dir,
T: Transaction<D>,
impl<FD, FS, D, T> Restore<D> for BlockListFile<FD, FS, D, T> where
FD: File<Array>,
FS: File<Node>,
D: Dir,
T: Transaction<D>,
sourceimpl<FD: Send, FS: Send, D: Send, T: Send> TensorAccess for BlockListFile<FD, FS, D, T>
impl<FD: Send, FS: Send, D: Send, T: Send> TensorAccess for BlockListFile<FD, FS, D, T>
sourceimpl<FD, FS, D, T> Transact for BlockListFile<FD, FS, D, T> where
FD: File<Array> + Transact,
FS: File<Node>,
D: Dir,
T: Transaction<D>,
impl<FD, FS, D, T> Transact for BlockListFile<FD, FS, D, T> where
FD: File<Array> + Transact,
FS: File<Node>,
D: Dir,
T: Transaction<D>,
Auto Trait Implementations
impl<FD, FS, D, T> RefUnwindSafe for BlockListFile<FD, FS, D, T> where
D: RefUnwindSafe,
FD: RefUnwindSafe,
FS: RefUnwindSafe,
T: RefUnwindSafe,
impl<FD, FS, D, T> Send for BlockListFile<FD, FS, D, T> where
D: Send,
FD: Send,
FS: Send,
T: Send,
impl<FD, FS, D, T> Sync for BlockListFile<FD, FS, D, T> where
D: Sync,
FD: Sync,
FS: Sync,
T: Sync,
impl<FD, FS, D, T> Unpin for BlockListFile<FD, FS, D, T> where
D: Unpin,
FD: Unpin,
FS: Unpin,
T: Unpin,
impl<FD, FS, D, T> UnwindSafe for BlockListFile<FD, FS, D, T> where
D: UnwindSafe,
FD: UnwindSafe,
FS: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<F> Match for F
impl<F> Match for F
sourcefn matches<T>(&self) -> bool where
T: TryCastFrom<Self>,
fn matches<T>(&self) -> bool where
T: TryCastFrom<Self>,
Returns true
if self
can be cast into the target type T
.
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<F, T> TryCastFrom<F> for T where
T: CastFrom<F>,
impl<F, T> TryCastFrom<F> for T where
T: CastFrom<F>,
sourcefn can_cast_from(&F) -> bool
fn can_cast_from(&F) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(f: F) -> Option<T>
fn opt_cast_from(f: F) -> Option<T>
Returns Some(Self)
if the source value can be cast into Self
, otherwise None
.
sourcefn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
fn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
Returns Ok(Self)
if the source value can be cast into Self
, otherwise calls on_err
.
sourceimpl<F, T> TryCastInto<T> for F where
T: TryCastFrom<F>,
impl<F, T> TryCastInto<T> for F where
T: TryCastFrom<F>,
sourcefn can_cast_into(&self) -> bool
fn can_cast_into(&self) -> bool
Test if self
can be cast into T
.
sourcefn opt_cast_into(self) -> Option<T>
fn opt_cast_into(self) -> Option<T>
Returns Some(T)
if self
can be cast into T
, otherwise None
.
sourcefn try_cast_into<Err, OnErr>(self, on_err: OnErr) -> Result<T, Err> where
OnErr: FnOnce(&Self) -> Err,
fn try_cast_into<Err, OnErr>(self, on_err: OnErr) -> Result<T, Err> where
OnErr: FnOnce(&Self) -> Err,
Returns Ok(T)
if self
can be cast into T
, otherwise calls on_err
.