tf.train.Int64List
Используется в tf.train.Example протоколах. Содержит список Int64.
Используется в блокнотах
| Используется в учебниках |
|---|
Протокол Example представляет собой представление следующего типа Python:
Dict[str,
Union[List[bytes],
List[int64],
List[float]]]
Этот протокол реализует часть List[int64].
from google.protobuf import text_format
example = text_format.Parse('''
features {
feature {key: "my_feature"
value {int64_list {value: [1, 2, 3, 4]} } }
}''',
tf.train.Example())
example.features.feature['my_feature'].int64_list.value
[1, 2, 3, 4]Используйте tf.io.parse_example, чтобы извлечь тензоры из сериализованного протокола Example:
tf.io.parse_example(
example.SerializeToString(),
features = {'my_feature': tf.io.RaggedFeature(dtype=tf.int64)})
{'my_feature': <tf.Tensor: shape=(4,), dtype=float32,
numpy=array([1, 2, 3, 4], dtype=int64)>}Подробные сведения об использовании см. в руководстве tf.train.Example.
| Атрибуты | |
|---|---|
value | repeated int64 value |
© 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/train/Int64List