Skip to content
Open
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
04cd682
Update nn.py
pctablet505 May 6, 2025
1a74465
Update nn.py
pctablet505 May 6, 2025
c11eb81
Update nn.py
pctablet505 May 6, 2025
c81e18c
Update nn.py
pctablet505 May 6, 2025
d938e20
Update nn.py
pctablet505 May 7, 2025
f60811e
Update nn.py
pctablet505 May 7, 2025
b3ae323
Merge branch 'master' of https://github.com/pctablet505/keras
pctablet505 May 12, 2025
28eeb24
Update random_grayscale.py
pctablet505 May 12, 2025
de81e5b
Update keras/src/layers/preprocessing/image_preprocessing/random_gray…
pctablet505 May 12, 2025
66661ac
Update random_grayscale_test.py
pctablet505 May 12, 2025
c37f2b5
code reformat
pctablet505 May 13, 2025
498dece
Update random_grayscale_test.py
pctablet505 May 13, 2025
b0b5f63
Merge branch 'master' of https://github.com/pctablet505/keras
pctablet505 May 21, 2025
653f5b1
changed compute_output_spec
pctablet505 May 21, 2025
e681e4c
Merge branch 'keras-team:master' into master
pctablet505 May 21, 2025
27ad80b
Update random_grayscale.py
pctablet505 May 26, 2025
50f6292
Merge branch 'master' of https://github.com/pctablet505/keras
pctablet505 May 29, 2025
579cc11
Reapply "Fixed issue with dot_product_attention when using TPU. (#21…
pctablet505 May 29, 2025
7a0c547
Improve error handling in _can_use_flash_attention for better debugging
pctablet505 May 29, 2025
f7a2290
Revert "Improve error handling in _can_use_flash_attention for better…
pctablet505 May 29, 2025
8bae892
Fix JAX API compatibility and improve error handling in `_can_use_fla…
pctablet505 May 29, 2025
ee196cd
Updated `dot_product_attention`
pctablet505 May 29, 2025
40583c8
Update nn.py
pctablet505 Jun 7, 2025
7c918ba
Update nn.py
pctablet505 Jun 7, 2025
a927e7e
Merge branch 'keras-team:master' into master
pctablet505 Jun 10, 2025
f04eafa
Merge branch 'keras-team:master' into master
pctablet505 Jul 7, 2025
bbc29a7
Merge branch 'keras-team:master' into master
pctablet505 Jul 14, 2025
bac3416
Merge branch 'keras-team:master' into master
pctablet505 Jul 15, 2025
98877eb
Created using Colab
pctablet505 Aug 18, 2025
39c559b
Merge branch 'keras-team:master' into master
pctablet505 Aug 20, 2025
417e4b1
Delete Model_Pruning.ipynb
pctablet505 Aug 20, 2025
14bfd9b
Merge branch 'master' of https://github.com/pctablet505/keras
pctablet505 Aug 20, 2025
9d34d0a
Merge branch 'keras-team:master' into master
pctablet505 Aug 26, 2025
20d29a8
Merge branch 'keras-team:master' into master
pctablet505 Sep 2, 2025
e469244
Merge branch 'keras-team:master' into master
pctablet505 Sep 16, 2025
fd197d9
Merge branch 'keras-team:master' into master
pctablet505 Sep 18, 2025
a6746e1
Merge branch 'keras-team:master' into master
pctablet505 Sep 30, 2025
6a5597d
Merge branch 'keras-team:master' into master
pctablet505 Oct 13, 2025
315f7f6
Merge branch 'keras-team:master' into master
pctablet505 Oct 25, 2025
30e4cdd
Merge branch 'keras-team:master' into master
pctablet505 Oct 31, 2025
04cf978
Merge branch 'keras-team:master' into master
pctablet505 Dec 8, 2025
8c98c18
Loosen numerical thresholds in OpenVINO export tests
pctablet505 Dec 10, 2025
5687248
Merge branch 'keras-team:master' into fix-openvino-thresholds-clean
pctablet505 Dec 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions keras/src/export/openvino_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def test_standard_model_export(self, model_type):

ov_output = compiled_model([ref_input])[compiled_model.output(0)]

self.assertAllClose(ref_output, ov_output)
self.assertAllClose(ref_output, ov_output, atol=1e-3, rtol=1e-3)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To improve maintainability and avoid magic numbers, consider defining the tolerance values 1e-3 as class-level constants. This makes it easier to understand their purpose and update them in one place if needed.

For example, you could add these attributes to the ExportOpenVINOTest class:

class ExportOpenVINOTest(testing.TestCase):
    OV_ATOL = 1e-3
    OV_RTOL = 1e-3

    # ... tests ...

Then, you can use them in your assertions like this:
self.assertAllClose(ref_output, ov_output, atol=self.OV_ATOL, rtol=self.OV_RTOL)


larger_input = np.concatenate([ref_input, ref_input], axis=0)
compiled_model([larger_input])
Expand Down Expand Up @@ -178,7 +178,7 @@ def call(self, inputs):
ov_inputs = list(ref_input)

ov_output = compiled_model(ov_inputs)[compiled_model.output(0)]
self.assertAllClose(ref_output, ov_output)
self.assertAllClose(ref_output, ov_output, atol=1e-3, rtol=1e-3)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Similar to my other comment, it would be better to use class-level constants for the tolerance values to improve maintainability and avoid repetition of magic numbers. For example: self.assertAllClose(ref_output, ov_output, atol=self.OV_ATOL, rtol=self.OV_RTOL).


# Test with keras.saving_lib
temp_filepath = os.path.join(
Expand Down Expand Up @@ -243,7 +243,7 @@ def build(self, y_shape, x_shape):
ov_output = compiled_model([ref_input_x, ref_input_y])[
compiled_model.output(0)
]
self.assertAllClose(ref_output, ov_output)
self.assertAllClose(ref_output, ov_output, atol=1e-3, rtol=1e-3)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Similar to my other comments, it would be better to use class-level constants for the tolerance values to improve maintainability and avoid repetition of magic numbers. For example: self.assertAllClose(ref_output, ov_output, atol=self.OV_ATOL, rtol=self.OV_RTOL).

larger_input_x = np.concatenate([ref_input_x, ref_input_x], axis=0)
larger_input_y = np.concatenate([ref_input_y, ref_input_y], axis=0)
compiled_model([larger_input_x, larger_input_y])
Loading