tf.errors.OperatorNotAllowedInGraphError
Возникает, когда в выполнении графика присутствует неподдерживаемый оператор.
tf.errors.OperatorNotAllowedInGraphError(
*args, **kwargs
)
Например, использование tf.Tensor в качестве Python bool внутри графика вызовет OperatorNotAllowedInGraphError. Итерация по значениям внутри tf.Tensor также не поддерживается в выполнении графика.
Пример:
@tf.function def iterate_over(t): a,b,c = t return a iterate_over(tf.constant([1, 2, 3])) Traceback (most recent call last): OperatorNotAllowedInGraphError: ...
© 2022 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 4.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/errors/OperatorNotAllowedInGraphError