mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2025-09-23 10:30:03 +00:00
[misc] update pre-commit and run all files (#4752)
* [misc] update pre-commit * [misc] run pre-commit * [misc] remove useless configuration files * [misc] ignore cuda for clang-format
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
from typing import List, Optional, Tuple
|
||||
|
||||
import torch
|
||||
|
||||
from ..registry import meta_profiler_function
|
||||
|
||||
|
||||
@@ -21,11 +23,13 @@ def torch_nn_func_instancenorm(
|
||||
|
||||
|
||||
@meta_profiler_function.register(torch.nn.functional.group_norm)
|
||||
def torch_nn_func_groupnorm(input: torch.Tensor,
|
||||
num_groups: int,
|
||||
weight: Optional[torch.Tensor] = None,
|
||||
bias: Optional[torch.Tensor] = None,
|
||||
eps: float = 1e-5) -> Tuple[int, int]:
|
||||
def torch_nn_func_groupnorm(
|
||||
input: torch.Tensor,
|
||||
num_groups: int,
|
||||
weight: Optional[torch.Tensor] = None,
|
||||
bias: Optional[torch.Tensor] = None,
|
||||
eps: float = 1e-5,
|
||||
) -> Tuple[int, int]:
|
||||
has_affine = weight is not None
|
||||
flops = input.numel() * (5 if has_affine else 4)
|
||||
macs = 0
|
||||
|
Reference in New Issue
Block a user