텐서플로우 constant()

1 개요[ | ]

텐서플로우 constant()
tf.constant()
import tensorflow as tf

a = tf.constant('Hello, World!')
b = tf.constant(42)
print( "a=", a )
print( "b=", b )
# a= Tensor("Const_25:0", shape=(), dtype=string)
# b= Tensor("Const_26:0", shape=(), dtype=int32)

sess = tf.Session()
print( "a=", sess.run(a) )
print( "b=", sess.run(b) )
# a= b'Hello, World!'
# b= 42

2 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}