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

Method reshape

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

Adds a node to the parent graph that reshapes a value associated with the node to a given compatible type. Applies [Graph::reshape] to the parent graph, `this` node and `new_type`. # Example ``` # use ciphercore_base::graphs::create_context; # use ciphercore_base::data_types::{INT32, array_type}; let c = create_context().unwrap(); let g = c.create_graph().unwrap(); let old_t = array_type(vec![3

(&self, new_type: Type)

Source from the content-addressed store, hash-verified

1021 /// let n2 = n1.reshape(new_t).unwrap();
1022 /// ```
1023 pub fn reshape(&self, new_type: Type) -> Result<Node> {
1024 self.get_graph().reshape(self.clone(), new_type)
1025 }
1026
1027 #[doc(hidden)]
1028 pub fn nop(&self) -> Result<Node> {

Callers 15

test_reshape_workerFunction · 0.45
test_reshape_worker_failFunction · 0.45
test_wellformed_casesFunction · 0.45
reshape_prepending_dimsFunction · 0.45
expand_dimsFunction · 0.45
unsqueezeFunction · 0.45
instantiateMethod · 0.45
normalize_cmpFunction · 0.45
instantiateMethod · 0.45
interleaveFunction · 0.45

Calls 4

cloneMethod · 0.80
add_nodeMethod · 0.80
get_graphMethod · 0.45

Tested by 7

test_reshape_workerFunction · 0.36
test_reshape_worker_failFunction · 0.36
test_wellformed_casesFunction · 0.36
test_reshapeFunction · 0.36