November 2018
Intermediate to advanced
322 pages
7h 54m
English
The TensorFlow library contains several built-in operations that can be applied on tensors. An operation node can be defined by passing input values and saving the output in another tensor. To understand this better, let's define two operations, op1 and op2:
op1 = tf.add(const2, const3)op2 = tf.multiply(const2, const3)
Let's print op1 and op2:
print('op1 : ', op1)print('op2 : ', op2)
The output is as follows, and shows that op1 and op2 are defined as tensors:
To print the output from executing these operations, the op1 and op2 tensors have to be executed in a TensorFlow session:
print('run(op1) : ', tfs.run(op1))print('run(op2) ...Read now
Unlock full access