log_memory_stats¶ torchtune.training.log_memory_stats(stats: Dict[str, float], message: str = 'Memory stats after model init:') → None[source]¶ 将包含内存统计信息的字典记录到日志中。stats 应包含 torchtune.training.get_memory_stats() 返回的字段 peak_memory_active、peak_memory_alloc 和 peak_memory_reserved。 参数: stats (Dict[str, float]) – 包含峰值活跃内存、峰值分配内存和峰值保留内存统计信息的字典。 message (str) – 可选消息,将添加到日志输出的前面。默认为“Memory stats after model init:”