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

■ placeholder 함수를 사용하는 방법을 보여준다.

 

▶ 예제 코드 (PY)

import tensorflow as tf

with tf.Session() as session:
    xTensor = tf.placeholder(tf.float32, [2], name = "x")
    yTensor = tf.placeholder(tf.float32, [2], name = "y")
    zTensor = tf.constant(2.0)
    yTensor = xTensor * zTensor
    xList = [3, 6]
    yNDArray = session.run(yTensor, {xTensor : xList})
    print(yNDArray)

[결과]

[6.]
728x90
그리드형(광고전용)
Posted by icodebroker
,