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

■ Session 클래스의 run 메소드를 사용해 1개 이상의 텐서 값을 구하는 방법을 보여준다.

 

▶ 예제 코드 (PY)

import tensorflow as tf

aConstantTensor = tf.constant([100.0])
bConstantTensor = tf.constant([300.0])
cConstantTensor = tf.constant([3.0])

addTensor      = tf.add(aConstantTensor, bConstantTensor)
multiplyTensor = tf.multiply(aConstantTensor, cConstantTensor)

with tf.Session() as session:
    result = session.run([addTensor, multiplyTensor])
    print(result)

[결과]

[array([400.], dtype=float32), array([300.], dtype=float32)]
728x90
반응형
그리드형(광고전용)
Posted by icodebroker

댓글을 달아 주세요