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

Function single_bit_to_arithmetic

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

Converts (individual) bits to 0/1 in arithmetic form.

(node: Node, st: ScalarType)

Source from the content-addressed store, hash-verified

154
155/// Converts (individual) bits to 0/1 in arithmetic form.
156pub fn single_bit_to_arithmetic(node: Node, st: ScalarType) -> Result<Node> {
157 let g = node.get_graph();
158 g.ones(scalar_type(st))?.mixed_multiply(node)
159}
160
161/// Similar to `numpy.expand_dims` `<https://numpy.org/doc/stable/reference/generated/numpy.expand_dims.html>`.
162///

Callers 1

instantiateMethod · 0.85

Calls 4

onesMethod · 0.80
scalar_typeFunction · 0.50
get_graphMethod · 0.45
mixed_multiplyMethod · 0.45

Tested by

no test coverage detected