pub struct ShapeInference;Implementations§
Source§impl ShapeInference
impl ShapeInference
pub fn infer_output_shape( op: &TensorOp, inputs: &[&TensorTypeInfo], attrs: Option<&Attributes>, ) -> Result<Vec<TensorTypeInfo>, String>
pub fn compute_flops( op: &TensorOp, inputs: &[&TensorTypeInfo], attrs: Option<&Attributes>, ) -> Option<u64>
Sourcepub fn compute_memory_bytes(
op: &TensorOp,
inputs: &[&TensorTypeInfo],
attrs: Option<&Attributes>,
) -> Option<u64>
pub fn compute_memory_bytes( op: &TensorOp, inputs: &[&TensorTypeInfo], attrs: Option<&Attributes>, ) -> Option<u64>
Sums every input’s bytes plus the output’s bytes — memory traffic
includes writing the result, not just reading the operands. Every op
family used to only get this for MatMul/SparseMatMul; every other
op (Conv*, Attention, Norm, pooling, activations, …) silently
omitted the output entirely, understating real traffic (e.g. by
~46% for a typical Conv2D).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ShapeInference
impl RefUnwindSafe for ShapeInference
impl Send for ShapeInference
impl Sync for ShapeInference
impl Unpin for ShapeInference
impl UnsafeUnpin for ShapeInference
impl UnwindSafe for ShapeInference
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