diff --git a/src/circuit/ops/layouts.rs b/src/circuit/ops/layouts.rs index fd8f4f31f..2e6227144 100644 --- a/src/circuit/ops/layouts.rs +++ b/src/circuit/ops/layouts.rs @@ -4323,11 +4323,13 @@ pub fn floor( // set the last element to zero and then recompose let zero = create_constant_tensor(F::ZERO, 1); - let assigned_zero = region.assign(&config.custom_gates.inputs[1], &zero)?; + let assigned_zero = region.assign(&config.custom_gates.inputs[0], &zero)?; let assigned_zero = assigned_zero.get_inner_tensor()?[0].clone(); let negative_one = create_constant_tensor(integer_rep_to_felt(-1), 1); let assigned_negative_one = region.assign(&config.custom_gates.inputs[1], &negative_one)?; + region.increment(1); + let dims = decomposition.dims().to_vec(); let first_dims = decomposition.dims().to_vec()[..decomposition.dims().len() - 1].to_vec(); @@ -4435,11 +4437,13 @@ pub fn ceil( // set the last element to zero and then recompose let zero = create_constant_tensor(F::ZERO, 1); - let assigned_zero = region.assign(&config.custom_gates.inputs[1], &zero)?; + let assigned_zero = region.assign(&config.custom_gates.inputs[0], &zero)?; let assigned_zero = assigned_zero.get_inner_tensor()?[0].clone(); let one = create_constant_tensor(integer_rep_to_felt(1), 1); let assigned_one = region.assign(&config.custom_gates.inputs[1], &one)?; + region.increment(1); + let dims = decomposition.dims().to_vec(); let first_dims = decomposition.dims().to_vec()[..decomposition.dims().len() - 1].to_vec(); @@ -4547,12 +4551,14 @@ pub fn round( // set the last element to zero and then recompose let zero = create_constant_tensor(F::ZERO, 1); - let assigned_zero = region.assign(&config.custom_gates.inputs[1], &zero)?; + let assigned_zero = region.assign(&config.custom_gates.inputs[0], &zero)?; let assigned_zero = assigned_zero.get_inner_tensor()?[0].clone(); let one = create_constant_tensor(integer_rep_to_felt(1), 1); let assigned_one = region.assign(&config.custom_gates.inputs[1], &one)?; let negative_one = create_constant_tensor(integer_rep_to_felt(-1), 1); - let assigned_negative_one = region.assign(&config.custom_gates.inputs[1], &negative_one)?; + let assigned_negative_one = region.assign(&config.custom_gates.output, &negative_one)?; + + region.increment(1); // if scale is not exactly divisible by 2 we warn if scale.0 % 2.0 != 0.0 {