What Does Tf.Constant Do

Source URL: https://www.tensorflow.org/api_docs/python/tf/constant

Language: whatever

Created on: 2021-01-31 12:24:43

# Constant 1-D Tensor from a python list.tf.constant([1, 2, 3, 4, 5, 6])<tf.Tensor: shape=(6,), dtype=int32,    numpy=array([1, 2, 3, 4, 5, 6], dtype=int32)># Or a numpy arraya = np.array([[1, 2, 3], [4, 5, 6]])tf.constant(a)<tf.Tensor: shape=(2, 3), dtype=int64, numpy=  array([[1, 2, 3],         [4, 5, 6]])>
Creates a constant tensor from a tensor-like object.
content_copy