from typing import Any

from ..base import BaseModel
from .loss_fn_output import LossFnOutput


class ForwardBackwardOutput(BaseModel):
    loss_fn_outputs: list[LossFnOutput]
    """每个 loss_fn 的输出列表, 列表长度等于提供样本的数量"""

    metrics: dict[str, float]
    """前向指标"""

    elapsed_time: float = 0.0
    """事件处理耗时, 毫秒"""

    debug: dict[str, Any] = {}
    """调试信息"""
