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

■ constant 함수를 사용해 상수를 만드는 방법을 보여준다.

 

▶ 예제 코드 (PY)

import numpy as np
import tensorflow as tf

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

constantTensor = tf.constant(ndArray)

with tf.Session() as session:
    print(constantTensor.get_shape())
    print(session.run(constantTensor))

[결과]

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

댓글을 달아 주세요