tico 0.1.0.dev250526__py3-none-any.whl → 0.1.0.dev250527__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- tico/__init__.py +1 -1
- tico/serialize/operators/op_abs.py +53 -0
- tico/utils/validate_args_kwargs.py +10 -0
- {tico-0.1.0.dev250526.dist-info → tico-0.1.0.dev250527.dist-info}/METADATA +1 -1
- {tico-0.1.0.dev250526.dist-info → tico-0.1.0.dev250527.dist-info}/RECORD +9 -8
- {tico-0.1.0.dev250526.dist-info → tico-0.1.0.dev250527.dist-info}/LICENSE +0 -0
- {tico-0.1.0.dev250526.dist-info → tico-0.1.0.dev250527.dist-info}/WHEEL +0 -0
- {tico-0.1.0.dev250526.dist-info → tico-0.1.0.dev250527.dist-info}/entry_points.txt +0 -0
- {tico-0.1.0.dev250526.dist-info → tico-0.1.0.dev250527.dist-info}/top_level.txt +0 -0
tico/__init__.py
CHANGED
@@ -22,7 +22,7 @@ from tico.config import CompileConfigV1, get_default_config
|
|
22
22
|
from tico.utils.convert import convert, convert_from_exported_program, convert_from_pt2
|
23
23
|
|
24
24
|
# THIS LINE IS AUTOMATICALLY GENERATED BY setup.py
|
25
|
-
__version__ = "0.1.0.
|
25
|
+
__version__ = "0.1.0.dev250527"
|
26
26
|
|
27
27
|
|
28
28
|
if Version(torch.__version__) < Version("2.5.0"):
|
@@ -0,0 +1,53 @@
|
|
1
|
+
# Copyright (c) 2025 Samsung Electronics Co., Ltd. All Rights Reserved
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
from typing import Dict, List, TYPE_CHECKING
|
16
|
+
|
17
|
+
if TYPE_CHECKING:
|
18
|
+
import torch._ops
|
19
|
+
import torch.fx
|
20
|
+
import torch
|
21
|
+
from circle_schema import circle
|
22
|
+
|
23
|
+
from tico.serialize.circle_graph import CircleSubgraph
|
24
|
+
from tico.serialize.operators.hashable_opcode import OpCode
|
25
|
+
from tico.serialize.operators.node_visitor import NodeVisitor, register_node_visitor
|
26
|
+
from tico.serialize.operators.utils import create_builtin_operator, get_op_index
|
27
|
+
from tico.utils.validate_args_kwargs import AbsArgs
|
28
|
+
|
29
|
+
|
30
|
+
@register_node_visitor
|
31
|
+
class AbsVisitor(NodeVisitor):
|
32
|
+
target: List[torch._ops.OpOverload] = [torch.ops.aten.abs.default]
|
33
|
+
|
34
|
+
def __init__(self, op_codes: Dict[OpCode, int], graph: CircleSubgraph):
|
35
|
+
super().__init__(op_codes, graph)
|
36
|
+
|
37
|
+
def define_node(
|
38
|
+
self,
|
39
|
+
node: torch.fx.Node,
|
40
|
+
) -> circle.Operator.OperatorT:
|
41
|
+
op_index = get_op_index(
|
42
|
+
circle.BuiltinOperator.BuiltinOperator.ABS, self._op_codes
|
43
|
+
)
|
44
|
+
|
45
|
+
args = AbsArgs(*node.args, **node.kwargs) # type: ignore[arg-type]
|
46
|
+
input = args.input
|
47
|
+
|
48
|
+
inputs = [input]
|
49
|
+
outputs = [node]
|
50
|
+
|
51
|
+
operator = create_builtin_operator(self.graph, op_index, inputs, outputs)
|
52
|
+
|
53
|
+
return operator
|
@@ -32,6 +32,16 @@ This file includes OpArgs classes that provide arguments with type annotations.
|
|
32
32
|
"""
|
33
33
|
|
34
34
|
|
35
|
+
@enforce_type
|
36
|
+
@dataclass
|
37
|
+
class AbsArgs:
|
38
|
+
"""
|
39
|
+
abs(Tensor self) -> Tensor
|
40
|
+
"""
|
41
|
+
|
42
|
+
input: torch.fx.Node
|
43
|
+
|
44
|
+
|
35
45
|
@enforce_type
|
36
46
|
@dataclass
|
37
47
|
class AddTensorArgs:
|
@@ -1,4 +1,4 @@
|
|
1
|
-
tico/__init__.py,sha256=
|
1
|
+
tico/__init__.py,sha256=zY__nsnts-mqniDecMFut79ZDvsK2yrh51Bcmt4F8rU,1181
|
2
2
|
tico/pt2_to_circle.py,sha256=PPmFNw20jw2Z2VyM3ln9pX__jTzBOAZiv0gT5a-p-Y8,2666
|
3
3
|
tico/config/__init__.py,sha256=xZzCXjZ84qE-CsBi-dfaL05bqpQ3stKKfTXhnrJRyVs,142
|
4
4
|
tico/config/base.py,sha256=anwOiJFkUxUi7Cef573JgQcjk6S-FSi6O_TLjYASW-g,1244
|
@@ -101,6 +101,7 @@ tico/serialize/quant_param.py,sha256=s97GJyDOZULnqFUWPakHais31G_qqPuO0awPHCkZDvI
|
|
101
101
|
tico/serialize/operators/__init__.py,sha256=LIvXsNnN4yUCS2CGNQ5XW8p8oXDTV_WHWuOEAw1t6WY,990
|
102
102
|
tico/serialize/operators/hashable_opcode.py,sha256=sDVKNTgIQw4IBtMEjNH8tzssMPx1x8-U2oagomRjGF0,1368
|
103
103
|
tico/serialize/operators/node_visitor.py,sha256=UYyCwXqSCeRyimThMShstHnt7vKM9tsuzQ_02uEwF9I,2356
|
104
|
+
tico/serialize/operators/op_abs.py,sha256=Y-vy7rcqPT-qD3QS5R8zbApWWTPpjY6xuMMVnbIhYmQ,1827
|
104
105
|
tico/serialize/operators/op_add.py,sha256=otm062DMHVAThWmOtSTZdPyP3P5-2cv5VL_UWBJeLms,2346
|
105
106
|
tico/serialize/operators/op_alias_copy.py,sha256=Xu9OiILbGf8oddh8yTqovvLfgVs8XYV7Cg4n6CesWcg,2175
|
106
107
|
tico/serialize/operators/op_any.py,sha256=WMsHLq7WIcl6rD2G3QqpWRSCR-a6UYX6y5AjB6BDS3U,5049
|
@@ -188,14 +189,14 @@ tico/utils/passes.py,sha256=kGmDe__5cPaO6i5EDAoXSVe6yXEoX9hAny4ROb3ZEmQ,2409
|
|
188
189
|
tico/utils/register_custom_op.py,sha256=iRQvdqlBqrJxq_pNkvJyDIJD_SYtCUl88wwbbuvSwlk,22952
|
189
190
|
tico/utils/trace_decorators.py,sha256=ddLIiKQfSaQrxgF1kNpwjFTQnXENzeSfcr1kuAW4jGI,3221
|
190
191
|
tico/utils/utils.py,sha256=pybDU1LoNhjEplANig11lboX9yzYRkvFCSmyYth_2Do,10359
|
191
|
-
tico/utils/validate_args_kwargs.py,sha256=
|
192
|
+
tico/utils/validate_args_kwargs.py,sha256=P4aMnr9EhNCtc_AgJPpuezfQbqFfDn0lhJSWqmumLZ8,25054
|
192
193
|
tico/utils/mx/__init__.py,sha256=IO6FP_xYbGy0dW0HL26GXD3ouxARaxCK7bz9dn4blPQ,26
|
193
194
|
tico/utils/mx/elemwise_ops.py,sha256=V6glyAHsVR1joqpsgnNytatCD_ew92xNWZ19UFDoMTA,10281
|
194
195
|
tico/utils/mx/formats.py,sha256=uzNWyu-1onUlwQfX5cZ6fZSUfHMRqorper7_T1k3jfk,3404
|
195
196
|
tico/utils/mx/mx_ops.py,sha256=RcfUTYVi-wilGB2sC35OeARdwDqnixv7dG5iyZ-fQT8,8555
|
196
|
-
tico-0.1.0.
|
197
|
-
tico-0.1.0.
|
198
|
-
tico-0.1.0.
|
199
|
-
tico-0.1.0.
|
200
|
-
tico-0.1.0.
|
201
|
-
tico-0.1.0.
|
197
|
+
tico-0.1.0.dev250527.dist-info/LICENSE,sha256=kp4JLII7bzRhPb0CPD5XTDZMh22BQ7h3k3B7t8TiSbw,12644
|
198
|
+
tico-0.1.0.dev250527.dist-info/METADATA,sha256=6z0-wJTVKt3EvNXMPY3CLHXIvQulhZdeQaJ1oMFhoz0,8633
|
199
|
+
tico-0.1.0.dev250527.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
|
200
|
+
tico-0.1.0.dev250527.dist-info/entry_points.txt,sha256=kBKYSS_IYrSXmUYevmmepqIVPScq5vF8ulQRu3I_Zf0,59
|
201
|
+
tico-0.1.0.dev250527.dist-info/top_level.txt,sha256=oqs7UPoNSKZEwqsX8B-KAWdQwfAa7i60pbxW_Jk7P3w,5
|
202
|
+
tico-0.1.0.dev250527.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|