If an operation computes a randomized output, return true
(&self)
| 276 | |
| 277 | // If an operation computes a randomized output, return true |
| 278 | pub fn is_randomizing(&self) -> Result<bool> { |
| 279 | match self { |
| 280 | Operation::Random(_) |
| 281 | | Operation::RandomPermutation(_) |
| 282 | | Operation::CuckooToPermutation |
| 283 | | Operation::DecomposeSwitchingMap(_) => Ok(true), |
| 284 | Operation::Input(_) |
| 285 | | Operation::Zeros(_) |
| 286 | | Operation::Ones(_) |
| 287 | | Operation::A2B |
| 288 | | Operation::Add |
| 289 | | Operation::ApplyPermutation(_) |
| 290 | | Operation::ArrayToVector |
| 291 | | Operation::Assert(_) |
| 292 | | Operation::B2A(_) |
| 293 | | Operation::Subtract |
| 294 | | Operation::Multiply |
| 295 | | Operation::MixedMultiply |
| 296 | | Operation::Matmul |
| 297 | | Operation::Dot |
| 298 | | Operation::Gemm(_, _) |
| 299 | | Operation::Truncate(_) |
| 300 | | Operation::Sum(_) |
| 301 | | Operation::CumSum(_) |
| 302 | | Operation::Concatenate(_) |
| 303 | | Operation::CreateNamedTuple(_) |
| 304 | | Operation::CreateTuple |
| 305 | | Operation::CreateVector(_) |
| 306 | | Operation::CuckooHash |
| 307 | | Operation::SegmentCumSum |
| 308 | | Operation::PermuteAxes(_) |
| 309 | | Operation::Get(_) |
| 310 | | Operation::Gather(_) |
| 311 | | Operation::GetSlice(_) |
| 312 | | Operation::Reshape(_) |
| 313 | | Operation::NOP |
| 314 | | Operation::InversePermutation |
| 315 | | Operation::PRF(_, _) |
| 316 | | Operation::PermutationFromPRF(_, _) |
| 317 | | Operation::Stack(_) |
| 318 | | Operation::NamedTupleGet(_) |
| 319 | | Operation::Sort(_) |
| 320 | | Operation::TupleGet(_) |
| 321 | | Operation::Constant(_, _) |
| 322 | | Operation::VectorGet |
| 323 | | Operation::Zip |
| 324 | | Operation::Repeat(_) |
| 325 | | Operation::VectorToArray |
| 326 | | Operation::Join(_, _) |
| 327 | | Operation::JoinWithColumnMasks(_, _) |
| 328 | | Operation::Print(_) |
| 329 | | Operation::Shard(_) => Ok(false), |
| 330 | Operation::Call | Operation::Iterate => Err(runtime_error!( |
| 331 | "The status of operations calling other graphs cannot be defined" |
| 332 | )), |
| 333 | Operation::Custom(_) => Err(runtime_error!( |
| 334 | "The status of custom operations cannot be defined" |
| 335 | )), |
no outgoing calls
no test coverage detected