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

Method is_const_optimizable

ciphercore-base/src/graphs.rs:268–275  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

266 }
267
268 pub fn is_const_optimizable(&self) -> Result<bool> {
269 match self {
270 // Zeros and Ones exist precisely because we don't want to store them as Constants
271 // to keep the graph size small.
272 Operation::Zeros(_) | Operation::Ones(_) => Ok(false),
273 op => Ok(!op.is_input() && !op.is_randomizing()?),
274 }
275 }
276
277 // If an operation computes a randomized output, return true
278 pub fn is_randomizing(&self) -> Result<bool> {

Callers 1

optimize_graph_constantsFunction · 0.80

Calls 2

is_inputMethod · 0.80
is_randomizingMethod · 0.80

Tested by

no test coverage detected