import tensorflow as tf import multiprocessing as mp core_num = mp.cpu_count() config = tf.ConfigProto( inter_op_parallelism_threads=core_num, intra_op_parallelism_threads=core_num ) a = tf.complex_abs([-1.2+6.7j, 3.4-5.7j, -9.9-3.4j]) ss= tf.Session(config=config) print(ss.run(a))