fix name confuse

This commit is contained in:
xujiao 2025-05-07 14:07:54 +08:00
parent 87e6c28404
commit dc12812dc6
26 changed files with 27 additions and 11 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,7 +1,7 @@
import os
import sys
from utils import check_path, AttributeCopier, creat_cla
from utils import check_path, AttributeCopier, create_cls
class Config(AttributeCopier):
def __init__(self, source_obj) -> None:
@ -29,7 +29,7 @@ def main():
network_name = sys.argv[1]
# 构建 netrans 可执行文件的路径
netrans_path =os.getenv('NETRANS_PATH')
cla = creat_cla(netrans_path, network_name)
cla = create_cls(netrans_path, network_name)
func = InputmetaGen(cla)
func.inputmeta_gen()

View File

@ -1,7 +1,7 @@
import os
import sys
import subprocess
from utils import check_path, AttributeCopier, creat_cla
from utils import check_path, AttributeCopier, create_cls
def check_status(result):
if result.returncode == 0:
@ -218,7 +218,7 @@ def main():
netrans_path = os.environ['NETRANS_PATH']
# netrans = os.path.join(netrans_path, 'pnnacc')
clas = creat_cla(netrans_path, network_name,verbose=False)
clas = create_cls(netrans_path, network_name,verbose=False)
func = ImportModel(clas)
func.import_network()
if __name__ == "__main__":

View File

@ -1,7 +1,7 @@
import os
import sys
import subprocess
from utils import check_path, AttributeCopier, creat_cla
from utils import check_path, AttributeCopier, create_cls
class Infer(AttributeCopier):
def __init__(self, source_obj) -> None:
@ -79,7 +79,7 @@ def main():
netrans_path = os.environ['NETRANS_PATH']
# netrans = os.path.join(netrans_path, 'pnnacc')
quantize_type = sys.argv[2]
cla = creat_cla(netrans_path, network_name,quantize_type,False)
cla = create_cls(netrans_path, network_name,quantize_type,False)
# 调用量化函数
func = Infer(cla)

View File

@ -0,0 +1,6 @@
Metadata-Version: 2.1
Name: netrans
Version: 0.1.0
Home-page: https://gitlink.org.cn/gwg_xujiao/netrans
Author: nudt_dsp
Requires-Dist: ruamel.yaml==0.18.6

View File

@ -0,0 +1,7 @@
README.md
setup.py
netrans.egg-info/PKG-INFO
netrans.egg-info/SOURCES.txt
netrans.egg-info/dependency_links.txt
netrans.egg-info/requires.txt
netrans.egg-info/top_level.txt

View File

@ -0,0 +1 @@

View File

@ -0,0 +1 @@
ruamel.yaml==0.18.6

View File

@ -0,0 +1 @@

View File

@ -1,6 +1,6 @@
import os
import sys
from utils import check_path, AttributeCopier, creat_cla
from utils import check_path, AttributeCopier, create_cls
class Quantize(AttributeCopier):
def __init__(self, source_obj) -> None:
@ -83,7 +83,7 @@ def main():
netrans_path = os.environ['NETRANS_PATH']
# netrans = os.path.join(netrans_path, 'pnnacc')
quantize_type = sys.argv[2]
cla = creat_cla(netrans_path, network_name,quantize_type)
cla = create_cls(netrans_path, network_name,quantize_type)
# 调用量化函数
run = Quantize(cla)

View File

@ -1,6 +1,6 @@
import os
import sys
from utils import check_path, AttributeCopier, creat_cla
from utils import check_path, AttributeCopier, create_cls
class Quantize(AttributeCopier):
def __init__(self, source_obj) -> None:
@ -81,7 +81,7 @@ def main():
netrans_path = os.environ['NETRANS_PATH']
# netrans = os.path.join(netrans_path, 'pnnacc')
quantize_type = sys.argv[2]
cla = creat_cla(netrans_path, network_name,quantize_type)
cla = create_cls(netrans_path, network_name,quantize_type)
# 调用量化函数
run = Quantize(cla)

View File

@ -63,7 +63,7 @@ class AttributeCopier:
def _get_attribute_names(source_obj):
return source_obj.__dict__.keys()
class creat_cla(): #dataclass @netrans_params
class create_cls(): #dataclass @netrans_params
def __init__(self, netrans_path, name, quantized_type = 'uint8',verbose=False) -> None:
self.netrans_path = netrans_path
self.netrans = os.path.join(self.netrans_path, 'pnnacc')