Python – tensorflow.get_logger()
TensorFlow 是由 Google 设计的开源Python库,用于开发机器学习模型和深度学习神经网络。
get_logger()用于获取记录器实例。
Syntax: tensorflow.get_logger()
Parameters: It doesn’t accept any parameters.
Returns: It returns the logger instance.
示例 1:
Python3
# Importing the library
import tensorflow as tf
# Fetting logger instance
logger = tf.get_logger()
# Checking if propagation is enabled
res = logger.propagate
# Printing the result
print('res: ',res)
Python3
# Importing the library
import tensorflow as tf
# Fetting logger instance
logger = tf.get_logger()
# Disabling the propagation
logger.propagate = False
# Checking if propagation is enabled
res = logger.propagate
# Printing the result
print('res: ',res)
输出:
res: True
示例 2:
Python3
# Importing the library
import tensorflow as tf
# Fetting logger instance
logger = tf.get_logger()
# Disabling the propagation
logger.propagate = False
# Checking if propagation is enabled
res = logger.propagate
# Printing the result
print('res: ',res)
输出:
res: False