[TensorFlow] demo1 tf.zeros 函数

定义的文件路径:tensorflow/python/ops/array_ops.py.

举个例子:

tf.zeros([3, 4], tf.int32)  # [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]

可以看出,创建一个数组并初始化它们都为0

Args:

shape: A list of integers, a tuple of integers, or a 1-D Tensor of type int32.
dtype: The type of an element in the resulting Tensor.
name: A name for the operation (optional).
Returns:
A Tensor with all elements set to zero.




你可能感兴趣的:(Python,TensorFlow)