tf.SparseTensorSpec
| Просмотреть исходный код на GitHub |
Спецификация типа для tf.sparse.SparseTensor.
tf.SparseTensorSpec(
shape=None, dtype=tf.dtypes.float32
)
| Аргументы | |
|---|---|
shape | Плотную форму SparseTensor, или None для разрешения любой плотной формы. |
dtype | tf.DType значений в SparseTensor. |
| Атрибуты | |
|---|---|
dtype | tf.dtypes.DType, указанный этим типом для SparseTensor. |
shape | tf.TensorShape, указанный этим типом для SparseTensor. |
value_type | |
Методы
from_value
@classmethod
from_value(
value
)
is_compatible_with
is_compatible_with(
spec_or_value
)
Возвращает true, если spec_or_value совместим с этим TypeSpec.
most_specific_compatible_type
most_specific_compatible_type(
other
)
Возвращает наиболее специфичную TypeSpec, совместимую с self и other.
| Аргументы | |
|---|---|
other | A TypeSpec. |
| Исключения | |
|---|---|
ValueError | Если нет TypeSpec, совместимой с self и other. |
__eq__
__eq__(
other
)
Возвращает self==value.
__ne__
__ne__(
other
)
Возвращает self!=value.
© 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.3/api_docs/python/tf/SparseTensorSpec