pub struct ConstantTensor {
pub data: TensorData,
pub shape: Vec<i64>,
pub data_type: i32,
}Expand description
Represents a constant tensor with its shape and type
Fields§
§data: TensorData§shape: Vec<i64>§data_type: i32Implementations§
Source§impl ConstantTensor
impl ConstantTensor
Sourcepub fn from_tensor_proto(tensor: &TensorProto) -> Result<Self, OnnxError>
pub fn from_tensor_proto(tensor: &TensorProto) -> Result<Self, OnnxError>
Create a ConstantTensor from a TensorProto
Sourcepub fn to_tensor_proto(&self, name: &str) -> TensorProto
pub fn to_tensor_proto(&self, name: &str) -> TensorProto
Convert to TensorProto
Trait Implementations§
Source§impl Clone for ConstantTensor
impl Clone for ConstantTensor
Source§fn clone(&self) -> ConstantTensor
fn clone(&self) -> ConstantTensor
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ConstantTensor
impl RefUnwindSafe for ConstantTensor
impl Send for ConstantTensor
impl Sync for ConstantTensor
impl Unpin for ConstantTensor
impl UnsafeUnpin for ConstantTensor
impl UnwindSafe for ConstantTensor
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