keras-nightly 3.14.0.dev2026011604__py3-none-any.whl → 3.14.0.dev2026011704__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- keras/src/backend/tensorflow/rnn.py +17 -7
- keras/src/backend/torch/rnn.py +28 -11
- keras/src/version.py +1 -1
- {keras_nightly-3.14.0.dev2026011604.dist-info → keras_nightly-3.14.0.dev2026011704.dist-info}/METADATA +1 -1
- {keras_nightly-3.14.0.dev2026011604.dist-info → keras_nightly-3.14.0.dev2026011704.dist-info}/RECORD +7 -7
- {keras_nightly-3.14.0.dev2026011604.dist-info → keras_nightly-3.14.0.dev2026011704.dist-info}/WHEEL +0 -0
- {keras_nightly-3.14.0.dev2026011604.dist-info → keras_nightly-3.14.0.dev2026011704.dist-info}/top_level.txt +0 -0
|
@@ -539,11 +539,21 @@ def _do_lstm_arguments_support_cudnn(
|
|
|
539
539
|
|
|
540
540
|
|
|
541
541
|
def _has_fully_masked_sequence(mask):
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
542
|
+
"""Check if input sequence contains any fully masked data.
|
|
543
|
+
|
|
544
|
+
cuDNN kernel will error out if the input sequence contains any fully masked
|
|
545
|
+
data. We work around this issue by rerouting the computation to the
|
|
546
|
+
standard kernel until the issue on the cuDNN side has been fixed. For a
|
|
547
|
+
fully masked sequence, it will contain all `False` values. To make it easy
|
|
548
|
+
to check, we invert the boolean and check if any of the sequences has all
|
|
549
|
+
`True` values.
|
|
550
|
+
|
|
551
|
+
Args:
|
|
552
|
+
mask: The mask tensor.
|
|
553
|
+
|
|
554
|
+
Returns:
|
|
555
|
+
A boolean tensor, `True` if the mask contains a fully masked sequence.
|
|
556
|
+
"""
|
|
547
557
|
return tf.reduce_any(
|
|
548
558
|
tf.reduce_all(tf.logical_not(tf.cast(mask, dtype="bool")), axis=1)
|
|
549
559
|
)
|
|
@@ -900,8 +910,8 @@ def _cudnn_lstm(
|
|
|
900
910
|
|
|
901
911
|
if tf.sysconfig.get_build_info()["is_rocm_build"]:
|
|
902
912
|
# ROCm MIOpen's weight sequence for LSTM is different from both
|
|
903
|
-
# canonical and
|
|
904
|
-
# MIOpen: [i, f, o, c]
|
|
913
|
+
# canonical and cuDNN format
|
|
914
|
+
# MIOpen: [i, f, o, c] cuDNN/Canonical: [i, f, c, o]
|
|
905
915
|
# i is input gate weights.
|
|
906
916
|
# f is forget gate weights.
|
|
907
917
|
# o is output gate weights.
|
keras/src/backend/torch/rnn.py
CHANGED
|
@@ -413,11 +413,21 @@ def _is_sequence_right_padded(mask):
|
|
|
413
413
|
|
|
414
414
|
|
|
415
415
|
def _has_fully_masked_sequence(mask):
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
416
|
+
"""Check if input sequence contains any fully masked data.
|
|
417
|
+
|
|
418
|
+
cuDNN kernel will error out if the input sequence contains any fully masked
|
|
419
|
+
data. We work around this issue by rerouting the computation to the
|
|
420
|
+
standard kernel until the issue on the cuDNN side has been fixed. For a
|
|
421
|
+
fully masked sequence, it will contain all `False` values. To make it easy
|
|
422
|
+
to check, we invert the boolean and check if any of the sequences has all
|
|
423
|
+
`True` values.
|
|
424
|
+
|
|
425
|
+
Args:
|
|
426
|
+
mask: The mask tensor.
|
|
427
|
+
|
|
428
|
+
Returns:
|
|
429
|
+
A boolean tensor, `True` if the mask contains a fully masked sequence.
|
|
430
|
+
"""
|
|
421
431
|
return torch.any(torch.all(~mask, dim=1))
|
|
422
432
|
|
|
423
433
|
|
|
@@ -447,8 +457,8 @@ def _compute_sequence_length_from_mask(mask, batch_first):
|
|
|
447
457
|
The masking tensor is a 2D boolean tensor with shape [batch, timestep]. For
|
|
448
458
|
any timestep that should be masked, the corresponding field will be False.
|
|
449
459
|
Consider the following example:
|
|
450
|
-
|
|
451
|
-
|
|
460
|
+
a = [[True, True, False, False]
|
|
461
|
+
[True, True, True, False]]
|
|
452
462
|
It is a (2, 4) tensor, and the corresponding sequence length result should
|
|
453
463
|
be 1D tensor with value [2, 3]. Note that the masking tensor must be right
|
|
454
464
|
padded that could be checked by, e.g., `is_sequence_right_padded()`.
|
|
@@ -467,12 +477,19 @@ def _compute_sequence_length_from_mask(mask, batch_first):
|
|
|
467
477
|
|
|
468
478
|
|
|
469
479
|
def prepare_lstm_weights(lstm, kernel, recurrent_kernel, bias, device):
|
|
470
|
-
"""Copies kernel and recurrent kernel weights
|
|
480
|
+
"""Copies kernel and recurrent kernel weights into the PyTorch format.
|
|
481
|
+
|
|
471
482
|
We split the kernel and recurrent kernel weights, create associated
|
|
472
|
-
torch tensors adapted to be in line with the
|
|
473
|
-
After we have copied the weights, we ensure the
|
|
474
|
-
the same device and memory layout is optimized for
|
|
483
|
+
torch tensors adapted to be in line with the cuDNN optimization.
|
|
484
|
+
After we have copied the weights, we ensure the parameters are on
|
|
485
|
+
the same device and memory layout is optimized for cuDNN.
|
|
475
486
|
|
|
487
|
+
Args:
|
|
488
|
+
lstm: The PyTorch LSTM layer to prepare weights for.
|
|
489
|
+
kernel: The kernel weights tensor.
|
|
490
|
+
recurrent_kernel: The recurrent kernel weights tensor.
|
|
491
|
+
bias: The bias tensor.
|
|
492
|
+
device: The device to place the tensors on.
|
|
476
493
|
"""
|
|
477
494
|
|
|
478
495
|
lstm = lstm.to(device)
|
keras/src/version.py
CHANGED
{keras_nightly-3.14.0.dev2026011604.dist-info → keras_nightly-3.14.0.dev2026011704.dist-info}/RECORD
RENAMED
|
@@ -128,7 +128,7 @@ keras/regularizers/__init__.py,sha256=542Shphw7W8h4Dyf2rmqMKUECVZ8IVBvN9g1LWhz-b
|
|
|
128
128
|
keras/saving/__init__.py,sha256=KvL2GZxjvgFgEhvEnkvqjIR9JSNHKz-NWZacXajsjLI,1298
|
|
129
129
|
keras/src/__init__.py,sha256=Gi4S7EiCMkE03PbdGNpFdaUYySWDs_FcAJ8Taz9Y1BE,684
|
|
130
130
|
keras/src/api_export.py,sha256=gXOkBOnmscV013WAc75lc4Up01-Kkg9EylIAT_QWctg,1173
|
|
131
|
-
keras/src/version.py,sha256=
|
|
131
|
+
keras/src/version.py,sha256=PYl1X5NcUeyqMJlZOu02EORfq3XehPpN28bC457e3F8,204
|
|
132
132
|
keras/src/activations/__init__.py,sha256=0nL3IFDB9unlrMz8ninKOWo-uCHasTUpTo1tXZb2u44,4433
|
|
133
133
|
keras/src/activations/activations.py,sha256=mogPggtp4CGldI3VOPNmesRxp6EbiR1_i4KLGaVwzL8,17614
|
|
134
134
|
keras/src/applications/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -214,7 +214,7 @@ keras/src/backend/tensorflow/nn.py,sha256=6vtZHzUED6_blUPE1Tnc3GAxPpJ2ebxoaiMn80
|
|
|
214
214
|
keras/src/backend/tensorflow/numpy.py,sha256=nIpMvr-g81I9KF74RD4AbU4e4t-0eFa9MND2Fh1u8Tk,104623
|
|
215
215
|
keras/src/backend/tensorflow/optimizer.py,sha256=kFlyEOnGjEYdLpd8mpwhUeku78__xBfZbbrDWpJrq60,9307
|
|
216
216
|
keras/src/backend/tensorflow/random.py,sha256=iO8V_soaDXZm9ewyAVbjudhsMj08C348c9Bz64nxXC4,6475
|
|
217
|
-
keras/src/backend/tensorflow/rnn.py,sha256=
|
|
217
|
+
keras/src/backend/tensorflow/rnn.py,sha256=JbOSpt48cm612c7YwiTYOQCQsNXyI_6QeRhtUn8qEvM,34829
|
|
218
218
|
keras/src/backend/tensorflow/sparse.py,sha256=a_FZcJY-wPl1x4vY0T7j-GORa4SAuMjNEToJLmK0daQ,32247
|
|
219
219
|
keras/src/backend/tensorflow/tensorboard.py,sha256=e7pXicuMfQjuCmq1wOmixWhWt2EbjLMBo_JPAqCbZRk,504
|
|
220
220
|
keras/src/backend/tensorflow/trackable.py,sha256=QZn0JvpBJ7Kx4e6zM2IVIWz9ADcWDB-dHN6vjoQBa9Q,1993
|
|
@@ -229,7 +229,7 @@ keras/src/backend/torch/math.py,sha256=g-ElDii2Y_o1-t6BAu2nbS7JH-aPqVS5Fqds8aYzI
|
|
|
229
229
|
keras/src/backend/torch/nn.py,sha256=zmEzXEuwD7fVRDm145zsxzUDmqNmRgZS4LmeIx4Nbus,37498
|
|
230
230
|
keras/src/backend/torch/numpy.py,sha256=gvHviedkAoEaTax89wDqUrjbUSX1ndjxicHy-PLv2Nc,57668
|
|
231
231
|
keras/src/backend/torch/random.py,sha256=YhLfC7qkGpzlU_i6gGPVormo3BMSo7OUA3TC3GCehrA,8292
|
|
232
|
-
keras/src/backend/torch/rnn.py,sha256=
|
|
232
|
+
keras/src/backend/torch/rnn.py,sha256=MJIVbHKsUA2dZm4Gu2NvRxlrFCWeWSxSZRmFxSsC3Zg,26041
|
|
233
233
|
keras/src/backend/torch/trainer.py,sha256=dcikz1c5O0FHNzRKSi6WhIHsHfLV2HDlrXPElSd1cgE,17985
|
|
234
234
|
keras/src/backend/torch/optimizers/__init__.py,sha256=yvqiyKgMEh-nGpacssdpsMySujyYB6lPy-Wil3onXvo,78
|
|
235
235
|
keras/src/backend/torch/optimizers/torch_adadelta.py,sha256=iPjGHvD7q_VD0WaMNxuNcvz8uIWd0smRyEMzMqryUD4,1672
|
|
@@ -618,7 +618,7 @@ keras/utils/bounding_boxes/__init__.py,sha256=jtvQll4u8ZY0Z96HwNhP1nxWEG9FM3gI-6
|
|
|
618
618
|
keras/utils/legacy/__init__.py,sha256=oSYZz6uS8UxSElRaaJYWJEoweJ4GAasZjnn7fNaOlog,342
|
|
619
619
|
keras/visualization/__init__.py,sha256=UKWmiy6sps4SWlmQi9WX8_Z53cPpLlphz2zIeHdwJpQ,722
|
|
620
620
|
keras/wrappers/__init__.py,sha256=QkS-O5K8qGS7C3sytF8MpmO6PasATpNVGF8qtb7Ojsw,407
|
|
621
|
-
keras_nightly-3.14.0.
|
|
622
|
-
keras_nightly-3.14.0.
|
|
623
|
-
keras_nightly-3.14.0.
|
|
624
|
-
keras_nightly-3.14.0.
|
|
621
|
+
keras_nightly-3.14.0.dev2026011704.dist-info/METADATA,sha256=XtouV2KcEzUqH0W897TEDF7jmTiNPzWoJyzib0rfKAo,6339
|
|
622
|
+
keras_nightly-3.14.0.dev2026011704.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
623
|
+
keras_nightly-3.14.0.dev2026011704.dist-info/top_level.txt,sha256=ptcw_-QuGZ4ZDjMdwi_Z0clZm8QAqFdvzzFnDEOTs9o,6
|
|
624
|
+
keras_nightly-3.14.0.dev2026011704.dist-info/RECORD,,
|
{keras_nightly-3.14.0.dev2026011604.dist-info → keras_nightly-3.14.0.dev2026011704.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|