pub struct ModelInputDimensions {
pub batch_size: usize,
pub sequence_length: usize,
pub num_options: usize,
}Expand description
検証済みのモデル入力次元情報。
Fields§
§batch_size: usizeバッチサイズ(質問並列数)。
sequence_length: usize入力系列長(パディング含む)。
num_options: usize評価候補数。
Implementations§
Source§impl ModelInputDimensions
impl ModelInputDimensions
Sourcepub fn new(
batch_size: usize,
sequence_length: usize,
num_options: usize,
) -> Result<Self>
pub fn new( batch_size: usize, sequence_length: usize, num_options: usize, ) -> Result<Self>
新規次元情報を構築し、仕様制約を満たしているか検証する。
Sourcepub fn validate_tensor_shapes(
input_ids_shape: &[usize],
attention_mask_shape: &[usize],
op_indices_shape: &[usize],
) -> Result<Self>
pub fn validate_tensor_shapes( input_ids_shape: &[usize], attention_mask_shape: &[usize], op_indices_shape: &[usize], ) -> Result<Self>
各入力テンソルの形状スライスを検証し、一致する次元情報を返却する。
Sourcepub fn validate_output_shape(&self, logits_shape: &[usize]) -> Result<()>
pub fn validate_output_shape(&self, logits_shape: &[usize]) -> Result<()>
出力 logits テンソルの形状が入力次元と整合しているか検証する。
Trait Implementations§
Source§impl Clone for ModelInputDimensions
impl Clone for ModelInputDimensions
Source§fn clone(&self) -> ModelInputDimensions
fn clone(&self) -> ModelInputDimensions
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ModelInputDimensions
Source§impl Debug for ModelInputDimensions
impl Debug for ModelInputDimensions
impl Eq for ModelInputDimensions
Source§impl PartialEq for ModelInputDimensions
impl PartialEq for ModelInputDimensions
impl StructuralPartialEq for ModelInputDimensions
Auto Trait Implementations§
impl Freeze for ModelInputDimensions
impl RefUnwindSafe for ModelInputDimensions
impl Send for ModelInputDimensions
impl Sync for ModelInputDimensions
impl Unpin for ModelInputDimensions
impl UnsafeUnpin for ModelInputDimensions
impl UnwindSafe for ModelInputDimensions
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.