mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2025-08-27 12:12:11 +00:00
* [fx] move meta registration * [fx] fix tests. * [fx] fix test. * [fx] fix. * [meta] refactor meta registration.py. * [fx] add compatibility descriptions. * [fx] polish import. * [fx] add a decorator. * [fx] fix tests. * [fx] remove print. * [fx] edit raise error. * [fx] edit raise error. * [fx] add type hint. * [fx] fix import in experimental. * [rpc] remove color debug. * [meta] fix naming.
19 lines
414 B
Python
19 lines
414 B
Python
import operator
|
|
from typing import Any, Tuple
|
|
import torch
|
|
from ..registry import meta_profiler_function
|
|
|
|
|
|
@meta_profiler_function.register(operator.getitem)
|
|
def operator_getitem(a: Any, b: Any) -> Tuple[int, int]:
|
|
flops = 0
|
|
macs = 0
|
|
return flops, macs
|
|
|
|
|
|
@meta_profiler_function.register(getattr)
|
|
def python_getattr(a: Any, b: Any) -> Tuple[int, int]:
|
|
flops = 0
|
|
macs = 0
|
|
return flops, macs
|