tico 0.1.0.dev250707__py3-none-any.whl → 0.1.0.dev250709__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_round.py +53 -0
- tico/utils/validate_args_kwargs.py +10 -0
- {tico-0.1.0.dev250707.dist-info → tico-0.1.0.dev250709.dist-info}/METADATA +3 -2
- {tico-0.1.0.dev250707.dist-info → tico-0.1.0.dev250709.dist-info}/RECORD +9 -8
- {tico-0.1.0.dev250707.dist-info → tico-0.1.0.dev250709.dist-info}/LICENSE +0 -0
- {tico-0.1.0.dev250707.dist-info → tico-0.1.0.dev250709.dist-info}/WHEEL +0 -0
- {tico-0.1.0.dev250707.dist-info → tico-0.1.0.dev250709.dist-info}/entry_points.txt +0 -0
- {tico-0.1.0.dev250707.dist-info → tico-0.1.0.dev250709.dist-info}/top_level.txt +0 -0
tico/__init__.py
CHANGED
@@ -21,7 +21,7 @@ from tico.config import CompileConfigV1, get_default_config
|
|
21
21
|
from tico.utils.convert import convert, convert_from_exported_program, convert_from_pt2
|
22
22
|
|
23
23
|
# THIS LINE IS AUTOMATICALLY GENERATED BY setup.py
|
24
|
-
__version__ = "0.1.0.
|
24
|
+
__version__ = "0.1.0.dev250709"
|
25
25
|
|
26
26
|
MINIMUM_SUPPORTED_VERSION = "2.5.0"
|
27
27
|
SECURE_TORCH_VERSION = "2.6.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 RoundArgs
|
28
|
+
|
29
|
+
|
30
|
+
@register_node_visitor
|
31
|
+
class RoundVisitor(NodeVisitor):
|
32
|
+
target: List[torch._ops.OpOverload] = [torch.ops.aten.round.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.ROUND, self._op_codes
|
43
|
+
)
|
44
|
+
|
45
|
+
args = RoundArgs(*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
|
@@ -933,6 +933,16 @@ class ResizeNearestNeighborArgs:
|
|
933
933
|
size: List[int]
|
934
934
|
|
935
935
|
|
936
|
+
@enforce_type
|
937
|
+
@dataclass
|
938
|
+
class RoundArgs:
|
939
|
+
"""
|
940
|
+
round(Tensor self) -> Tensor
|
941
|
+
"""
|
942
|
+
|
943
|
+
input: torch.fx.Node
|
944
|
+
|
945
|
+
|
936
946
|
@enforce_type
|
937
947
|
@dataclass
|
938
948
|
class RsqrtArgs:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: tico
|
3
|
-
Version: 0.1.0.
|
3
|
+
Version: 0.1.0.dev250709
|
4
4
|
Summary: Convert exported Torch module to circle
|
5
5
|
Home-page: UNKNOWN
|
6
6
|
License: UNKNOWN
|
@@ -43,7 +43,8 @@ designed for optimized on-device neural network inference.
|
|
43
43
|
0. Prerequisites
|
44
44
|
|
45
45
|
- Python 3.10
|
46
|
-
- [one-compiler 1.30.0](https://github.com/Samsung/ONE/releases/tag/1.30.0)
|
46
|
+
- (Optional) [one-compiler 1.30.0](https://github.com/Samsung/ONE/releases/tag/1.30.0)
|
47
|
+
- It is only required if you intend to run inference with the converted Circle model. If you are only converting models without running them, this dependency is not needed.
|
47
48
|
|
48
49
|
We highly recommend to use a virtual env, e.g., conda.
|
49
50
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
tico/__init__.py,sha256=
|
1
|
+
tico/__init__.py,sha256=uUyBqMHPDHaFA-Jf9XrT1UKDQ1UbQTvgqju8rx5nxQg,1743
|
2
2
|
tico/pt2_to_circle.py,sha256=gu3MD4Iqc0zMZcCZ2IT8oGbyj21CTSbT3Rgd9s2B_9A,2767
|
3
3
|
tico/config/__init__.py,sha256=xZzCXjZ84qE-CsBi-dfaL05bqpQ3stKKfTXhnrJRyVs,142
|
4
4
|
tico/config/base.py,sha256=anwOiJFkUxUi7Cef573JgQcjk6S-FSi6O_TLjYASW-g,1244
|
@@ -161,6 +161,7 @@ tico/serialize/operators/op_relu6.py,sha256=ZWqEolfAKjOdUC1ZCg0iuu4dBhkJRxVYR2tU
|
|
161
161
|
tico/serialize/operators/op_repeat.py,sha256=0wTv1Mg7kg0eHz0CT6atyVAli4T4h5rYXq5opY6op20,4235
|
162
162
|
tico/serialize/operators/op_reshape.py,sha256=0_bJwimiGAHaKkfwfhxUw9Gebt5tnecGaEVoKhEvV0Q,2550
|
163
163
|
tico/serialize/operators/op_resize_nearest_neighbor.py,sha256=dXaAnZ5M_ko_tH-HolxNpHFXkDUQ8x45myskojP5XZE,2771
|
164
|
+
tico/serialize/operators/op_round.py,sha256=pe6w_TB4xGLu0iPv4Qo0a0fIkY9DgCgXk5127TWt8pE,1837
|
164
165
|
tico/serialize/operators/op_rsqrt.py,sha256=yl2vd8InjhLPbE0vHIrEera6DVXlY9dLgO7yZZCH3RI,1837
|
165
166
|
tico/serialize/operators/op_scalar_tensor.py,sha256=vDWxi4hXwyDJJhvfMR_QrBInw_No3WeU_M4gtfZqmbo,1928
|
166
167
|
tico/serialize/operators/op_select_copy.py,sha256=GPLN7QZmwSlA4WRbjfU6pLer3KVWzgaYsZPJXw_vv9g,2305
|
@@ -195,14 +196,14 @@ tico/utils/register_custom_op.py,sha256=3-Yl6iYmx1qQA2igNHt4hYhQhQMkdPb7gF50LIY8
|
|
195
196
|
tico/utils/serialize.py,sha256=AQXMBOLu-Kg2Rn-qbqsAtHndjZAZIavlKA0QFgJREHM,1420
|
196
197
|
tico/utils/trace_decorators.py,sha256=ddLIiKQfSaQrxgF1kNpwjFTQnXENzeSfcr1kuAW4jGI,3221
|
197
198
|
tico/utils/utils.py,sha256=fnbZ2RLH6-J-wqb32O4qsR1ce4BJU0wYNrk84QXa6_E,13158
|
198
|
-
tico/utils/validate_args_kwargs.py,sha256=
|
199
|
+
tico/utils/validate_args_kwargs.py,sha256=3dXkNll9E9eZq-p0HjYaV4YltQESqdEHBU34k-tIg1k,26733
|
199
200
|
tico/utils/mx/__init__.py,sha256=IO6FP_xYbGy0dW0HL26GXD3ouxARaxCK7bz9dn4blPQ,26
|
200
201
|
tico/utils/mx/elemwise_ops.py,sha256=V6glyAHsVR1joqpsgnNytatCD_ew92xNWZ19UFDoMTA,10281
|
201
202
|
tico/utils/mx/formats.py,sha256=uzNWyu-1onUlwQfX5cZ6fZSUfHMRqorper7_T1k3jfk,3404
|
202
203
|
tico/utils/mx/mx_ops.py,sha256=RcfUTYVi-wilGB2sC35OeARdwDqnixv7dG5iyZ-fQT8,8555
|
203
|
-
tico-0.1.0.
|
204
|
-
tico-0.1.0.
|
205
|
-
tico-0.1.0.
|
206
|
-
tico-0.1.0.
|
207
|
-
tico-0.1.0.
|
208
|
-
tico-0.1.0.
|
204
|
+
tico-0.1.0.dev250709.dist-info/LICENSE,sha256=kp4JLII7bzRhPb0CPD5XTDZMh22BQ7h3k3B7t8TiSbw,12644
|
205
|
+
tico-0.1.0.dev250709.dist-info/METADATA,sha256=zpUu_UaIWzup7BHIowx8BPnplKbnS6lJoHCYfvs_t_c,8430
|
206
|
+
tico-0.1.0.dev250709.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
|
207
|
+
tico-0.1.0.dev250709.dist-info/entry_points.txt,sha256=kBKYSS_IYrSXmUYevmmepqIVPScq5vF8ulQRu3I_Zf0,59
|
208
|
+
tico-0.1.0.dev250709.dist-info/top_level.txt,sha256=oqs7UPoNSKZEwqsX8B-KAWdQwfAa7i60pbxW_Jk7P3w,5
|
209
|
+
tico-0.1.0.dev250709.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|