简体   繁体   中英

How to extract name from tf.contrib.layers.fully_connected()

I have this in my graph:

output_layer = tf.contrib.layers.fully_connected(input, output_size, activation_fn=None)

I would like to refer to it within another function. Usually, we can name an operation or tensor and use get_tensor_by_name(name) to refer to it later. The fully_connected() function does not have name as an argument.

Is there another way to refer to output_layer?

您可以通过访问.name属性获取张量的完整“路径”:

print(output_layer.name)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM