Skip to content

layers.TimeDistributed produce non-nan results for nan inputs with openvino backend #22061

@thanhlecongg

Description

@thanhlecongg

Description

With x2 is nan and openvino backend, arctan2 still returns non-nan results though it should be nan (the results are nan with other backend and np.arctan2).
Please use this example to replicate the problem:

import os
os.environ["KERAS_BACKEND"] = "openvino"


from keras.src.ops import numpy as knp
import numpy as np


out1 = knp.arctan2(1.0, np.nan)
print(out1.numpy())
# 1.5703125


out2 = np.arctan2(1.0, np.nan)
print(out2)
# NaN 

Environment

  • Keras: 3.13.1
  • Python: 3.11
  • OS: macOS

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions