diff --git a/hdk/common/common_helpers.py b/hdk/common/common_helpers.py index e0c872c9a..c0f2d8fdf 100644 --- a/hdk/common/common_helpers.py +++ b/hdk/common/common_helpers.py @@ -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 ) diff --git a/hdk/common/data_types/integers.py b/hdk/common/data_types/integers.py index 49c04e23f..f4753f09b 100644 --- a/hdk/common/data_types/integers.py +++ b/hdk/common/data_types/integers.py @@ -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) diff --git a/hdk/common/representation/intermediate.py b/hdk/common/representation/intermediate.py index 163b87d60..db78a6e4f 100644 --- a/hdk/common/representation/intermediate.py +++ b/hdk/common/representation/intermediate.py @@ -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 diff --git a/hdk/common/tracing/base_tracer.py b/hdk/common/tracing/base_tracer.py index 3519f30d4..188f30e16 100644 --- a/hdk/common/tracing/base_tracer.py +++ b/hdk/common/tracing/base_tracer.py @@ -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, ) diff --git a/tests/common/bounds_measurement/test_dataset_eval.py b/tests/common/bounds_measurement/test_dataset_eval.py index f2e331412..cdf30691a 100644 --- a/tests/common/bounds_measurement/test_dataset_eval.py +++ b/tests/common/bounds_measurement/test_dataset_eval.py @@ -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():