refactor: 优化参数传递,清理导入样式
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import torch.nn as nn
|
||||
from typing import Dict
|
||||
|
||||
import torch.nn as nn
|
||||
|
||||
|
||||
def grad_norm(model: nn.Module, norm_type: int = 2) -> Dict[str, float]:
|
||||
"""Compute gradient norm for each parameter in the model."""
|
||||
|
||||
Reference in New Issue
Block a user