MCPcopy Index your code
hub / github.com/ciphermodelabs/ciphercore / ones

Method ones

ciphercore-base/src/graphs.rs:1609–1611  ·  view source on GitHub ↗

Adds an node with ones of given type. Compared to `constant` this node does produce a big value array in serialized graph. # Arguments `t` - node type # Returns New node with ones of given type. # Example ``` # use ciphercore_base::graphs::create_context; # use ciphercore_base::data_types::{UINT8, array_type}; let c = create_context().unwrap(); let g = c.create_graph().unwrap(); let z = g.o

(&self, t: Type)

Source from the content-addressed store, hash-verified

1607 /// let z = g.ones(array_type(vec![10, 20], UINT8)).unwrap();
1608 /// ```
1609 pub fn ones(&self, t: Type) -> Result<Node> {
1610 self.add_node(vec![], vec![], Operation::Ones(t))
1611 }
1612
1613 /// Adds a node that sums two arrays or scalars of the same scalar type elementwise.
1614 ///

Callers 15

instantiateMethod · 0.80
test_instantiation_passFunction · 0.80
instantiateMethod · 0.80
ones_likeFunction · 0.80
single_bit_to_arithmeticFunction · 0.80
cumulative_orFunction · 0.80
instantiateMethod · 0.80
from_a_bMethod · 0.80
joinMethod · 0.80
instantiateMethod · 0.80
instantiateMethod · 0.80
instantiateMethod · 0.80

Calls 1

add_nodeMethod · 0.80

Tested by 3

test_instantiation_passFunction · 0.64
test_onesFunction · 0.64
test_onesFunction · 0.64