21import tensorflow
as tf
23visible_device_list =
'0'
24per_process_gpu_memory_fraction = 0.9
25intra_op_parallelism_threads = 2
26inter_op_parallelism_threads = 5
28gpu_options = tf.compat.v1.GPUOptions(
29 per_process_gpu_memory_fraction = per_process_gpu_memory_fraction,
30 visible_device_list = visible_device_list,
33config = tf.compat.v1.ConfigProto(
34 allow_soft_placement =
True,
35 log_device_placement =
False,
36 intra_op_parallelism_threads = intra_op_parallelism_threads,
37 inter_op_parallelism_threads = inter_op_parallelism_threads,
38 gpu_options = gpu_options)
40s = config.SerializeToString()
43print(
'a serialized protobuf string for TF_SetConfig, note the byte order is in normal order.')
44b =
''.join(
format(b,
'02x')
for b
in s)
static const char *const format[]
static void print(AVTreeNode *t, int depth)