mirror of
https://github.com/zama-ai/concrete.git
synced 2026-02-09 12:15:09 -05:00
committed by
Benoit Chevallier
parent
b79fd775d0
commit
ee832079ba
@@ -16,8 +16,8 @@ def ir_nodes_has_integer_input_and_output(node: ir.IntermediateNode) -> bool:
|
||||
Returns:
|
||||
bool: True if all input and output values hold Integers
|
||||
"""
|
||||
return all(map(lambda x: isinstance(x.data_type, Integer), node.inputs)) and all(
|
||||
map(lambda x: isinstance(x.data_type, Integer), node.outputs)
|
||||
return all(isinstance(x.data_type, Integer) for x in node.inputs) and all(
|
||||
isinstance(x.data_type, Integer) for x in node.outputs
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ def make_integer_to_hold_ints(values: Iterable[int], force_signed: bool) -> Inte
|
||||
Returns:
|
||||
Integer: The Integer able to hold values
|
||||
"""
|
||||
assert all(map(lambda x: isinstance(x, int), values))
|
||||
assert all(isinstance(x, int) for x in values)
|
||||
min_value = min(values)
|
||||
max_value = max(values)
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ class IntermediateNode(ABC):
|
||||
op_kwargs: Optional[Dict[str, Any]] = None,
|
||||
) -> None:
|
||||
self.inputs = list(inputs)
|
||||
assert all(map(lambda x: isinstance(x, BaseValue), self.inputs))
|
||||
assert all(isinstance(x, BaseValue) for x in self.inputs)
|
||||
self.op_args = op_args
|
||||
self.op_kwargs = op_kwargs
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ class BaseTracer(ABC):
|
||||
sanitized_inputs = [sanitize(inp) for inp in inputs]
|
||||
|
||||
traced_computation = computation_to_trace(
|
||||
map(lambda x: x.output, sanitized_inputs),
|
||||
(x.output for x in sanitized_inputs),
|
||||
op_args=op_args,
|
||||
op_kwargs=op_kwargs,
|
||||
)
|
||||
|
||||
@@ -213,7 +213,7 @@ def test_eval_op_graph_bounds_on_dataset_multiple_output(
|
||||
yield (x_gen, y_gen)
|
||||
|
||||
node_bounds = eval_op_graph_bounds_on_dataset(
|
||||
op_graph, data_gen(*tuple(map(lambda x: range(x[0], x[1] + 1), input_ranges)))
|
||||
op_graph, data_gen(*tuple(range(x[0], x[1] + 1) for x in input_ranges))
|
||||
)
|
||||
|
||||
for i, output_node in op_graph.output_nodes.items():
|
||||
|
||||
Reference in New Issue
Block a user