📜  Python – tensorflow.IndexedSlicesSpec()

📅  最后修改于: 2022-05-13 01:55:04.485000             🧑  作者: Mango

Python – tensorflow.IndexedSlicesSpec()

TensorFlow 是由 Google 设计的开源Python库,用于开发机器学习模型和深度学习神经网络。

IndexedSlicesSpec继承自 TypeSpec 并为 IndexedSlices 提供类型规范。

示例 1:此示例使用所有默认值。

Python3
# Importing the library
import tensorflow as tf
 
# Calculating result
res = tf.IndexedSlicesSpec()
 
# Printing the result
print('IndexedSlicesSpec: ', res)


Python3
# Importing the library
import tensorflow as tf
 
# Calculating result
res = tf.IndexedSlicesSpec((2, 3))
 
# Printing the result
print('IndexedSlicesSpec: ', res)


输出:

IndexedSlicesSpec:  IndexedSlicesSpec(TensorShape(None), tf.float32, tf.int64, None, TensorShape([None]))

示例 2:

Python3

# Importing the library
import tensorflow as tf
 
# Calculating result
res = tf.IndexedSlicesSpec((2, 3))
 
# Printing the result
print('IndexedSlicesSpec: ', res)

输出:

IndexedSlicesSpec:  IndexedSlicesSpec(TensorShape([2, 3]), tf.float32, tf.int64, None, TensorShape([None]))