tf.debugging.assert_type
| Просмотреть исходный код на GitHub |
Проверяет, что заданный Tensor имеет указанный тип.
tf.debugging.assert_type(
tensor, tf_type, message=None, name=None
)
Это всегда можно проверить статически, поэтому этот метод ничего не возвращает.
| Аргументы | |
|---|---|
tensor | A Tensor или SparseTensor. |
tf_type | Тип тензора TensorFlow (dtypes.float32, tf.int64, dtypes.bool и т.д.). |
message | Строка, добавляемая к стандартному сообщению. |
name | Имя этой операции. По умолчанию — "assert_type". |
| Исключения | |
|---|---|
TypeError | Если тип данных тензора не соответствует tf_type. |
© 2020 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/versions/r2.4/api_docs/python/tf/debugging/assert_type