Python – tensorflow.get_logger()
TensorFlow是谷歌设计的开源Python库,用于开发机器学习模型和深度学习神经网络。
get_logger()用于获取记录器实例。
语法: tensorflow.get_logger()
参数:它不接受任何参数。
返回:它返回记录器实例。
示例 1:
# 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)
输出:
res: True
示例 2:
# 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