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

Function pull_out_bits

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

Panics if `x` is not an array.

(x: Node)

Source from the content-addressed store, hash-verified

44
45/// Panics if `x` is not an array.
46pub fn pull_out_bits(x: Node) -> Result<Node> {
47 let shape = x.get_type()?.get_dimensions();
48 if shape.len() == 1 {
49 Ok(x)
50 } else {
51 let mut axes_permutation = vec![shape.len() as u64 - 1];
52 axes_permutation.extend(0..shape.len() as u64 - 1);
53 Ok(x.permute_axes(axes_permutation)?)
54 }
55}
56
57pub fn pull_out_bits_for_type(t: Type) -> Result<Type> {
58 if !t.is_array() {

Callers 9

pull_out_bits_pairFunction · 0.85
reduce_mulFunction · 0.85
instantiateMethod · 0.85
preprocess_inputFunction · 0.85
instantiateMethod · 0.85
instantiateMethod · 0.85
create_approximationFunction · 0.85
instantiateMethod · 0.85

Calls 4

get_dimensionsMethod · 0.80
get_typeMethod · 0.45
extendMethod · 0.45
permute_axesMethod · 0.45

Tested by

no test coverage detected