stdlib/shapeView source ↗
shape
7 items · generated by scribe fromstdlib/shape.fd· synced 2026-11-15
stdlib/shape7 items
Contents
- assert_ndim (function)
- assert_size (function)
- assert_same_shape (function)
- assert_matmul_compatible (function)
- assert_reshape (function)
- shape_1x1: (const)
assert_ndim
Assert that a tensor has the expected number of dimensions.
pub fn assert_ndim(t: Tensor, expected: i64) -> void {Parameters:
t:Tensorexpected:i64
Returns: void
Defined at line 16
assert_size
Assert that a tensor has a specific size (total elements).
pub fn assert_size(t: Tensor, expected: i64) -> void {Parameters:
t:Tensorexpected:i64
Returns: void
Defined at line 29
assert_same_shape
Assert that two tensors have the same shape (for elementwise ops).
pub fn assert_same_shape(a: Tensor, b: Tensor, op: str) -> void {Parameters:
a:Tensorb:Tensorop:str
Returns: void
Defined at line 42
assert_matmul_compatible
Assert that two tensors are compatible for matmul: a is (M, K) and b is (K, N).
pub fn assert_matmul_compatible(a: Tensor, b: Tensor) -> void {Parameters:
a:Tensorb:Tensor
Returns: void
Defined at line 79
assert_reshape
Assert that a reshape is valid: total size must be preserved.
pub fn assert_reshape(t: Tensor, new_size: i64) -> void {Parameters:
t:Tensornew_size:i64
Returns: void
Defined at line 105
shape_1x1:
pub const shape_1x1: Vec<i64> = vec_lit(1, 1); pub const shape_2x2: Vec<i64> = vec_lit(2, 2); pub const shape_2x3: Vec<i64> = vec_lit(2, 3); pub const shape_3x2: Vec<i64> = vec_lit(3, 2); pub const shape_3x4: Vec<i64> = vec_lit(3, 4); pub const shape_4x2: Vec<i64> = vec_lit(4, 2); pub const shape_4x4: Vec<i64> = vec_lit(4, 4); pub const shape_1x3: Vec<i64> = vec_lit(1, 3); pub const shape_1x4: Vec<i64> = vec_lit(1, 4); pub const shape_4x1: Vec<i64> = vec_lit(4, 1);Defined at line 121
Generated by scribe, the Fides documentation generator