첨부 실행 코드는 나눔고딕코딩 폰트를 사용합니다.
728x90
반응형
728x170

■ Variable 클래스를 사용해 변수를 만드는 방법을 보여준다.

 

▶ 예제 코드 (PY)

import numpy as np
import tensorflow as tf

ndArray = np.array([(1, 2, 3), (4, 5, 6), (7, 8, 9)])

variable = tf.Variable(ndArray)

with tf.Session() as sess:
    sess.run(tf.global_variables_initializer())
    print(variable.get_shape())
    print(sess.run(variable))

[결과]

(3, 3)
[[1 2 3]
 [4 5 6]
 [7 8 9]]
728x90
반응형
그리드형(광고전용)
Posted by icodebroker

댓글을 달아 주세요