pub struct TensorPatterns;Expand description
Helper for creating common tensor patterns
Implementations§
Source§impl TensorPatterns
impl TensorPatterns
Sourcepub fn weight_matrix(
name: String,
input_dim: u64,
output_dim: u64,
tensor_type: TensorType,
data: Vec<u8>,
) -> Result<(TensorInfo, TensorData)>
pub fn weight_matrix( name: String, input_dim: u64, output_dim: u64, tensor_type: TensorType, data: Vec<u8>, ) -> Result<(TensorInfo, TensorData)>
Create a weight matrix tensor
Sourcepub fn bias_vector(
name: String,
dim: u64,
tensor_type: TensorType,
data: Vec<u8>,
) -> Result<(TensorInfo, TensorData)>
pub fn bias_vector( name: String, dim: u64, tensor_type: TensorType, data: Vec<u8>, ) -> Result<(TensorInfo, TensorData)>
Create a bias vector tensor
Sourcepub fn embedding_matrix(
name: String,
vocab_size: u64,
embedding_dim: u64,
tensor_type: TensorType,
data: Vec<u8>,
) -> Result<(TensorInfo, TensorData)>
pub fn embedding_matrix( name: String, vocab_size: u64, embedding_dim: u64, tensor_type: TensorType, data: Vec<u8>, ) -> Result<(TensorInfo, TensorData)>
Create an embedding matrix
Auto Trait Implementations§
impl Freeze for TensorPatterns
impl RefUnwindSafe for TensorPatterns
impl Send for TensorPatterns
impl Sync for TensorPatterns
impl Unpin for TensorPatterns
impl UnsafeUnpin for TensorPatterns
impl UnwindSafe for TensorPatterns
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