Skip to main content

StackSamples

Trait StackSamples 

Source
pub trait StackSamples: Sized {
    type Batch;

    // Required method
    fn stack_samples(samples: Vec<Self>) -> Result<Self::Batch, DataError>;
}
Expand description

サンプル列(Vec<Self>)を 1 バッチへ積み上げる型(IterableBatches が使う)。

pub である理由: 公開 impl Iterator for IterableBatches の where 節に現れるため、pub(crate) にすると private_bounds lint (-D warnings)に抵触する。実装は Tensor<T> と 2/3 要素タプルのみ。

Required Associated Types§

Source

type Batch

積み上げ後のバッチ型。

Required Methods§

Source

fn stack_samples(samples: Vec<Self>) -> Result<Self::Batch, DataError>

samples を先頭軸へ積む。空は DataError::EmptyBatch。

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<A, B, C> StackSamples for (A, B, C)

Source§

impl<A, B> StackSamples for (A, B)

Implementors§

Source§

impl<T> StackSamples for Tensor<T>
where T: Element,