I tied to print one value while i train my Transformer.
@tf.function
def train_step(inp, tar):
tar_inp = tar[:, :-1]
tar_real = tar[:, 1:]
global i
if i == 1:
print('__________________')
tf.print('Inp: ', inp, output_stream=sys.stdout)
tf.print('Tar: ', tar, output_stream=sys.stdout)
tf.print('Tar_inp: ', tar_inp, output_stream=sys.stdout)
tf.print('Tar_real: ', tar_real, output_stream=sys.stdout)
i += 1
.......
But tf.print doesn't print anything. However my first print('_') works
What did I do wrong? Pls, help me to print my tensors.
UPDATE:
U also could explain to me the structure of tar_inp and tar_real instead of fixing tf. print.