with tf.compat.v1.Session() as sess:
with tf.device(device_option):
sess.run(tf.compat.v1.global_variables_initializer())
output_vals = sess.run(ops)
return namedtupledict("Outputs", node.outputs)(*output_vals)
@classmethod
After Change
module = TFModule(node)
output_vals = module(**input_dict)
output_vals = [val.numpy() if isinstance(val, tf.Tensor) else valfor val in output_vals]
return namedtupledict("Outputs", node.outputs)(*output_vals)