MCPcopy Create free account
hub / github.com/ciphermodelabs/ciphercore / pull_out_bits_pair

Function pull_out_bits_pair

ciphercore-base/src/ops/utils.rs:72–81  ·  view source on GitHub ↗

Like pull_out_bits but for a pair of nodes, aligning the "bits dimension" before pulling out.

(x: Node, y: Node)

Source from the content-addressed store, hash-verified

70
71// Like pull_out_bits but for a pair of nodes, aligning the "bits dimension" before pulling out.
72pub fn pull_out_bits_pair(x: Node, y: Node) -> Result<(Node, Node)> {
73 let num_dims = std::cmp::max(
74 x.get_type()?.get_shape().len(),
75 y.get_type()?.get_shape().len(),
76 );
77 Ok((
78 pull_out_bits(reshape_prepending_dims(x, num_dims)?)?,
79 pull_out_bits(reshape_prepending_dims(y, num_dims)?)?,
80 ))
81}
82
83pub fn prepend_dims(shape: ArrayShape, num_dims: usize) -> Result<ArrayShape> {
84 match shape.len() {

Callers 2

instantiateMethod · 0.85
instantiateMethod · 0.85

Calls 4

pull_out_bitsFunction · 0.85
reshape_prepending_dimsFunction · 0.85
get_shapeMethod · 0.80
get_typeMethod · 0.45

Tested by

no test coverage detected