Commit 8914427
Patch release commits for 3.13.1 (#22005)
* Remove NumPy warning with NumPy >= 2. (#21949)
Merely importing keras currently triggers this warning with NumPy 2.
```
keras/src/export/tf2onnx_lib.py:8: FutureWarning: In the future `np.object` will be defined as the corresponding NumPy scalar.
```
Only patch NumPy if and when needed.
* Fix CUDNN flash attention for JAX > 0.6.2. (#21970)
The signature of `check_is_flash_attention` changed with JAX 0.7.0. In addition to `query` and `key`, a positional argument of `value` was added.
This was not caught as our kokoro tests use JAX 0.6.2 because it's the last version that supports Python 3.10.
This change was tested here: #21957
* Do no always make batch size dynamic during export. (#21944)
This is a follow-up of #21674
This PR changed the signature of `make_tf_tensor_spec` from `(x)` to `(x, dynamic_batch=True)`, thereby adding the ability to make the batch size dynamic.
This PR also adds `_get_save_spec(self, dynamic_batch=True)` which uses `make_tf_tensor_spec` and forwards the `dynamic_batch` argument.
However, the default before this change for other export (SavedModel, ONNX) was to keep the batch size untouched. In particular, when a user manually provides an `input_signature` to [`ExportArchive.add_endpoint`](https://github.com/keras-team/keras/blob/master/keras/src/export/saved_model.py#L362), we should honor. The user controls whether the batch size is dynamic or not in the `input_signature`.
This PR changes the default of `make_tf_tensor_spec` back to `dynamic_batch=False` to revert SavedModel and ONNX exports to the previous behavior.
Also removed call to `return super()._get_save_spec(dynamic_batch)` which can never succeed as `TFLayer` is a top level class (ignoring the auto-tracking stuff).
* Cherry pick & patch release
---------
Co-authored-by: hertschuh <1091026+hertschuh@users.noreply.github.com>1 parent 986ff97 commit 8914427
File tree
5 files changed
+43
-30
lines changed- keras/src
- backend
- jax
- tensorflow
- export
5 files changed
+43
-30
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1471 | 1471 | | |
1472 | 1472 | | |
1473 | 1473 | | |
1474 | | - | |
| 1474 | + | |
| 1475 | + | |
1475 | 1476 | | |
1476 | 1477 | | |
1477 | 1478 | | |
1478 | 1479 | | |
1479 | 1480 | | |
1480 | 1481 | | |
1481 | | - | |
| 1482 | + | |
1482 | 1483 | | |
1483 | | - | |
1484 | | - | |
1485 | | - | |
1486 | 1484 | | |
1487 | 1485 | | |
1488 | | - | |
1489 | | - | |
1490 | | - | |
1491 | | - | |
| 1486 | + | |
| 1487 | + | |
| 1488 | + | |
| 1489 | + | |
1492 | 1490 | | |
| 1491 | + | |
| 1492 | + | |
| 1493 | + | |
| 1494 | + | |
| 1495 | + | |
| 1496 | + | |
| 1497 | + | |
| 1498 | + | |
| 1499 | + | |
| 1500 | + | |
| 1501 | + | |
| 1502 | + | |
| 1503 | + | |
| 1504 | + | |
| 1505 | + | |
| 1506 | + | |
| 1507 | + | |
| 1508 | + | |
| 1509 | + | |
1493 | 1510 | | |
1494 | 1511 | | |
1495 | 1512 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
113 | 109 | | |
114 | 110 | | |
115 | 111 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
| 105 | + | |
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | 8 | | |
12 | 9 | | |
13 | 10 | | |
| |||
20 | 17 | | |
21 | 18 | | |
22 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
0 commit comments