diff --git a/tests/tt_eager/python_api_testing/sweep_tests/tt_lib_ops.py b/tests/tt_eager/python_api_testing/sweep_tests/tt_lib_ops.py index 3eec6eef4b1..4f6bc6ce792 100644 --- a/tests/tt_eager/python_api_testing/sweep_tests/tt_lib_ops.py +++ b/tests/tt_eager/python_api_testing/sweep_tests/tt_lib_ops.py @@ -1288,7 +1288,7 @@ def clip( **kwargs, ): t0 = setup_tt_tensor(x, device, layout[0], input_mem_config[0], dtype[0]) - t1 = ttnn.clip(t0, min=low, max=high, memory_config=output_mem_config) + t1 = ttnn.clip(t0, low, high, memory_config=output_mem_config) return tt2torch_tensor(t1) diff --git a/tests/ttnn/unit_tests/operations/eltwise/test_activation.py b/tests/ttnn/unit_tests/operations/eltwise/test_activation.py index ab3ed7d3c83..57f8ecf4284 100644 --- a/tests/ttnn/unit_tests/operations/eltwise/test_activation.py +++ b/tests/ttnn/unit_tests/operations/eltwise/test_activation.py @@ -349,11 +349,11 @@ def run_activation_test_scalarBC_key(device, h, w, scalar1, scalar2, ttnn_functi torch_input_tensor_a = torch.rand((h, w), dtype=torch.bfloat16) golden_function = ttnn.get_golden_function(ttnn_function) - torch_output_tensor = golden_function(torch_input_tensor_a, min=scalar1, max=scalar2) + torch_output_tensor = golden_function(torch_input_tensor_a, scalar1, scalar2) input_tensor_a = ttnn.from_torch(torch_input_tensor_a, layout=ttnn.TILE_LAYOUT, device=device) - output_tensor = ttnn_function(input_tensor_a, min=scalar1, max=scalar2) + output_tensor = ttnn_function(input_tensor_a, scalar1, scalar2) output_tensor = ttnn.to_layout(output_tensor, ttnn.ROW_MAJOR_LAYOUT) output_tensor = ttnn.from_device(output_tensor) output_tensor = ttnn.to_torch(output_tensor) diff --git a/tests/ttnn/unit_tests/operations/eltwise/test_composite.py b/tests/ttnn/unit_tests/operations/eltwise/test_composite.py index 05c71cf113e..b38bdc82a15 100644 --- a/tests/ttnn/unit_tests/operations/eltwise/test_composite.py +++ b/tests/ttnn/unit_tests/operations/eltwise/test_composite.py @@ -112,12 +112,12 @@ def test_unary_composite_clamp_ttnn(input_shapes, min, max, device): in_data1, input_tensor1 = data_gen_with_range(input_shapes, -100, 100, device) if min is None and max is None: with pytest.raises(RuntimeError, match="Only one of 'min' or 'max' can be None. Please provide one value"): - ttnn.clamp(input_tensor1, min=min, max=max) + ttnn.clamp(input_tensor1, min, max) assert True else: - output_tensor = ttnn.clamp(input_tensor1, min=min, max=max) + output_tensor = ttnn.clamp(input_tensor1, min, max) golden_function = ttnn.get_golden_function(ttnn.clamp) - golden_tensor = golden_function(in_data1, min=min, max=max) + golden_tensor = golden_function(in_data1, min, max) comp_pass = compare_pcc([output_tensor], [golden_tensor]) assert comp_pass @@ -149,12 +149,12 @@ def test_unary_composite_clip_ttnn(input_shapes, min, max, device): in_data1, input_tensor1 = data_gen_with_range(input_shapes, -100, 100, device) if min is None and max is None: with pytest.raises(RuntimeError, match="Only one of 'min' or 'max' can be None. Please provide one value"): - ttnn.clip(input_tensor1, min=min, max=max) + ttnn.clip(input_tensor1, min, max) assert True else: - output_tensor = ttnn.clip(input_tensor1, min=min, max=max) + output_tensor = ttnn.clip(input_tensor1, min, max) golden_function = ttnn.get_golden_function(ttnn.clip) - golden_tensor = golden_function(in_data1, min=min, max=max) + golden_tensor = golden_function(in_data1, min, max) comp_pass = compare_pcc([output_tensor], [golden_tensor]) assert comp_pass diff --git a/ttnn/cpp/ttnn/operations/eltwise/unary/unary_pybind.hpp b/ttnn/cpp/ttnn/operations/eltwise/unary/unary_pybind.hpp index cf2ba6de4b0..78c74b02cf9 100644 --- a/ttnn/cpp/ttnn/operations/eltwise/unary/unary_pybind.hpp +++ b/ttnn/cpp/ttnn/operations/eltwise/unary/unary_pybind.hpp @@ -67,9 +67,9 @@ void bind_unary_composite_optional_floats_with_default(py::module& module, const return self(input_tensor, parameter_a, parameter_b, memory_config); }, py::arg("input_tensor"), - py::kw_only(), py::arg(parameter_name_a.c_str()) = parameter_a_value, py::arg(parameter_name_b.c_str()) = parameter_b_value, + py::kw_only(), py::arg("memory_config") = std::nullopt}); } diff --git a/ttnn/ttnn/operations/unary.py b/ttnn/ttnn/operations/unary.py index b7d3aa79a53..aa3b2e048d7 100644 --- a/ttnn/ttnn/operations/unary.py +++ b/ttnn/ttnn/operations/unary.py @@ -289,7 +289,7 @@ def _golden_function_polygamma(input_tensor_a, k, *args, **kwargs): def _golden_function_clamp(input_tensor_a, min=None, max=None, *args, **kwargs): import torch - return torch.clamp(input=input_tensor_a, min=min, max=max) + return torch.clamp(input_tensor_a, min, max) ttnn.attach_golden_function(ttnn.clamp, golden_function=_golden_function_clamp) @@ -298,7 +298,7 @@ def _golden_function_clamp(input_tensor_a, min=None, max=None, *args, **kwargs): def _golden_function_clip(input_tensor_a, min=None, max=None, *args, **kwargs): import torch - return torch.clip(input=input_tensor_a, min=min, max=max) + return torch.clip(input_tensor_a, min, max) ttnn.attach_golden_function(ttnn.clip, golden_function=_golden_function_clip)