Spec-Zone.ru › TensorFlow 2.3

tf.compat.v1.convert_to_tensor_or_indexed_slices

Преобразует заданный объект в Tensor или IndexedSlices.

tf.compat.v1.convert_to_tensor_or_indexed_slices(
    value, dtype=None, name=None
)

Если value является IndexedSlices или SparseTensor, он возвращается без изменений. В противном случае он преобразуется в Tensor с помощью convert_to_tensor().

Аргументы
value Объект IndexedSlices, SparseTensor, или объект, который может быть обработан convert_to_tensor().
dtype (Необязательно.) Требуемый DType возвращаемого Tensor или IndexedSlices.
name (Необязательно.) Имя для использования, если создается новый Tensor.
Возвращаемое значение
Tensor, IndexedSlices, или SparseTensor в зависимости от value.
Исключения
ValueError Если dtype не соответствует типу элемента 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/compat/v1/convert_to_tensor_or_indexed_slices

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API