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

Method stack

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

Adds a node that joins a sequence of arrays governed by a given shape. The input arrays should have the same shape or be able to be broadcast to the same shape. For example, stacking 2 arrays of shapes `[2,2]` and `[2,1]` with the outer shape `[2]` works as follows `stack(arrays=[[[1,2],[3,4]], [5,6]], shape=[2]) = [[[1,2],[3,4]], [[5,5], [6,6]]]` # Arguments `nodes` - vector of nodes contain

(&self, nodes: Vec<Node>, outer_shape: ArrayShape)

Source from the content-addressed store, hash-verified

2589 /// let n3 = g.stack(vec![n1,n2], shape).unwrap();
2590 /// ```
2591 pub fn stack(&self, nodes: Vec<Node>, outer_shape: ArrayShape) -> Result<Node> {
2592 self.add_node(nodes, vec![], Operation::Stack(outer_shape))
2593 }
2594
2595 /// Adds a node that joins a sequence of arrays along a given axis.
2596 /// This operation is similar to [the NumPy concatenate](https://numpy.org/doc/stable/reference/generated/numpy.concatenate.html).

Callers 6

test_stack_workerFunction · 0.45
test_stack_worker_failFunction · 0.45
test_wellformed_casesFunction · 0.45
test_stackFunction · 0.45
get_oprf_mask_graphFunction · 0.45

Calls 1

add_nodeMethod · 0.80

Tested by 5

test_stack_workerFunction · 0.36
test_stack_worker_failFunction · 0.36
test_wellformed_casesFunction · 0.36
test_stackFunction · 0.36