1 tf
tf.constant
Creates a constant tensor from a tensor-like object.
tf.constant(
value, dtype=None, shape=None, name='Const'
)
2 tf.math
tf.math.add
Returns x + y element-wise.
tf.math.add(
x, y, name=None
)
tf.math.add_n
Adds all input tensors element-wise.
tf.math.add_n
performs the same operation as tf.math.accumulate_n
.
This op does not broadcast its inputs. If you need broadcasting, use tf.math.add (or the + operator) instead.
import tensorflow as tf
tf.math.add_n(
inputs, name=None
)
"""参数
# inputs: A list of tf.Tensor or tf.IndexedSlices objects, each with the same shape and type.
"""
tf.cast()
tf.cast()函数的作用是执行 tensorflow 中张量数据类型转换。