tico 0.1.0.dev250909__py3-none-any.whl → 0.1.0.dev250910__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 CHANGED
@@ -29,7 +29,7 @@ __all__ = [
29
29
  ]
30
30
 
31
31
  # THIS LINE IS AUTOMATICALLY GENERATED BY setup.py
32
- __version__ = "0.1.0.dev250909"
32
+ __version__ = "0.1.0.dev250910"
33
33
 
34
34
  MINIMUM_SUPPORTED_VERSION = "2.5.0"
35
35
  SECURE_TORCH_VERSION = "2.6.0"
@@ -41,6 +41,8 @@ ops_to_promote = {
41
41
  torch.ops.aten.ge.Tensor: ELEMENTWISE_TYPE_PROMOTION_KIND.DEFAULT,
42
42
  torch.ops.aten.gt.Scalar: ELEMENTWISE_TYPE_PROMOTION_KIND.DEFAULT,
43
43
  torch.ops.aten.gt.Tensor: ELEMENTWISE_TYPE_PROMOTION_KIND.DEFAULT,
44
+ torch.ops.aten.le.Scalar: ELEMENTWISE_TYPE_PROMOTION_KIND.DEFAULT,
45
+ torch.ops.aten.le.Tensor: ELEMENTWISE_TYPE_PROMOTION_KIND.DEFAULT,
44
46
  torch.ops.aten.mul.Tensor: ELEMENTWISE_TYPE_PROMOTION_KIND.DEFAULT,
45
47
  torch.ops.aten.minimum.default: ELEMENTWISE_TYPE_PROMOTION_KIND.DEFAULT,
46
48
  torch.ops.aten.ne.Scalar: ELEMENTWISE_TYPE_PROMOTION_KIND.DEFAULT,
@@ -0,0 +1,54 @@
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 LeArgs
28
+
29
+
30
+ @register_node_visitor
31
+ class LeVisitor(NodeVisitor):
32
+ target: List[torch._ops.OpOverload] = [
33
+ torch.ops.aten.le.Scalar,
34
+ torch.ops.aten.le.Tensor,
35
+ ]
36
+
37
+ def __init__(self, op_codes: Dict[OpCode, int], graph: CircleSubgraph):
38
+ super().__init__(op_codes, graph)
39
+
40
+ def define_node(self, node: torch.fx.Node) -> circle.Operator.OperatorT:
41
+ args = LeArgs(*node.args, **node.kwargs) # type: ignore[arg-type]
42
+ input = args.input
43
+ other = args.other
44
+
45
+ op_index = get_op_index(
46
+ circle.BuiltinOperator.BuiltinOperator.LESS_EQUAL, self._op_codes
47
+ )
48
+
49
+ inputs = [input, other]
50
+ outputs = [node]
51
+
52
+ operator = create_builtin_operator(self.graph, op_index, inputs, outputs)
53
+
54
+ return operator
@@ -563,6 +563,18 @@ class InstanceNormArgs:
563
563
  cudnn_enabled: bool
564
564
 
565
565
 
566
+ @enforce_type
567
+ @dataclass
568
+ class LeArgs:
569
+ """
570
+ le.Scalar(Tensor self, Scalar other) -> Tensor
571
+ le.Tensor(Tensor self, Tensor other) -> Tensor
572
+ """
573
+
574
+ input: Union[torch.fx.Node, torch.Tensor, float, int]
575
+ other: Union[torch.fx.Node, torch.Tensor, float, int]
576
+
577
+
566
578
  @enforce_type
567
579
  @dataclass
568
580
  class LeakyReluArgs:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tico
3
- Version: 0.1.0.dev250909
3
+ Version: 0.1.0.dev250910
4
4
  Summary: Convert exported Torch module to circle
5
5
  Home-page: UNKNOWN
6
6
  License: UNKNOWN
@@ -1,4 +1,4 @@
1
- tico/__init__.py,sha256=c5spmq5DrUrTLuWPal98sdmfFYPjuRym0xcEnK9Am_U,1883
1
+ tico/__init__.py,sha256=eBhicYU7uvGKY-jtosltTu-YM_XO_4uLajrDI3Qn1ow,1883
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=q5xMqGxTUZs4mFqt5c7i_y9U00fYgdMGl9nUqIVMlCo,1248
@@ -102,7 +102,7 @@ tico/interpreter/interpreter.py,sha256=tGbluCbrehTCqBu8mtGDNzby_ieJ2ry8_RH_eC0CQ
102
102
  tico/passes/__init__.py,sha256=IO6FP_xYbGy0dW0HL26GXD3ouxARaxCK7bz9dn4blPQ,26
103
103
  tico/passes/cast_aten_where_arg_type.py,sha256=QOaet85z23ad3s9c8md5r11q9dEw4-lfJqlpM7aiBic,7228
104
104
  tico/passes/cast_clamp_mixed_type_args.py,sha256=m3_HpXLywWmWERfE5lM5PgvjBod7C4BWu_Q-TkRyO8k,5387
105
- tico/passes/cast_mixed_type_args.py,sha256=oXC0nDRnx4DJvmkzSVFVGqa4d2ICZvSarkXPgi9vTig,7621
105
+ tico/passes/cast_mixed_type_args.py,sha256=Wd3sCDKJZwdb8GiMWKljm8X5CLFRd8eCz-dmWks15Hc,7763
106
106
  tico/passes/const_prop_pass.py,sha256=hDxGgJNiRjsgOArdaoeAOcOOA-nKBvA1W1zcMZQA5yg,11531
107
107
  tico/passes/convert_conv1d_to_conv2d.py,sha256=ktS3h158y9rg1sQiW8BZZbflV_dk_UdjBPQnuiOKyzg,5303
108
108
  tico/passes/convert_layout_op_to_reshape.py,sha256=sCAFjkmVtiKjvDQSAgnjNBHl3_hWXJZElGDXQiTH-7s,2963
@@ -176,6 +176,7 @@ tico/serialize/operators/op_gt.py,sha256=JAVbtuAUNLYhtJycJJCEkYo9QAvmiK4lTMdw5yH
176
176
  tico/serialize/operators/op_index.py,sha256=iDW2YSeUS_kLiWEaQ_MjrYpxZAFBbm7_GU_2B4SRe6c,3033
177
177
  tico/serialize/operators/op_index_select.py,sha256=O2MXXWGnCgS8QG3DrWKdYKbl88VBVscmOuoGcgBEf_0,2522
178
178
  tico/serialize/operators/op_instance_norm.py,sha256=5QvLefa74BrAPsTNYsi4Y7IB8d1wer4gtWantKo2nlQ,2940
179
+ tico/serialize/operators/op_le.py,sha256=Ok0i973iiI_xzuTPL_0XndowcDta7VgBv-dacis9JRQ,1889
179
180
  tico/serialize/operators/op_leaky_relu.py,sha256=UJPoL7kAIp6nAjyDdda_afdOcMLHme7NE77b2y76exc,2160
180
181
  tico/serialize/operators/op_linear.py,sha256=bw_mn2CiJy8CbpPevOV0PMPh0ZMWKAybLZ9cnIKJSsk,2527
181
182
  tico/serialize/operators/op_log.py,sha256=1TKvH2lttdAHE0P84vcxmOvGBBRUs6D71Jrei7SdZHE,1827
@@ -245,14 +246,14 @@ tico/utils/signature.py,sha256=R2GV0alRpXEbZISqPKyxCUWbgDcsrQ2ovbVG3737IzA,9595
245
246
  tico/utils/torch_compat.py,sha256=oc6PztVsXdHcQ3iaVR90wLLxrGaj6zFHWZ8K9rRS6q8,1795
246
247
  tico/utils/trace_decorators.py,sha256=ddLIiKQfSaQrxgF1kNpwjFTQnXENzeSfcr1kuAW4jGI,3221
247
248
  tico/utils/utils.py,sha256=aySftYnNTsqVAMcGs_3uX3-hz577a2cj4p1aVV-1XeQ,12747
248
- tico/utils/validate_args_kwargs.py,sha256=aY7hyDaZKrZn0ev0liUFZdHS8__0Vpp5QyqDEobZ_zM,27163
249
+ tico/utils/validate_args_kwargs.py,sha256=RhBOHShi7DRHpCV_j4UcACk6wz4b1SUTWKj494_6zCQ,27439
249
250
  tico/utils/mx/__init__.py,sha256=IO6FP_xYbGy0dW0HL26GXD3ouxARaxCK7bz9dn4blPQ,26
250
251
  tico/utils/mx/elemwise_ops.py,sha256=V6glyAHsVR1joqpsgnNytatCD_ew92xNWZ19UFDoMTA,10281
251
252
  tico/utils/mx/formats.py,sha256=uzNWyu-1onUlwQfX5cZ6fZSUfHMRqorper7_T1k3jfk,3404
252
253
  tico/utils/mx/mx_ops.py,sha256=RcfUTYVi-wilGB2sC35OeARdwDqnixv7dG5iyZ-fQT8,8555
253
- tico-0.1.0.dev250909.dist-info/LICENSE,sha256=kp4JLII7bzRhPb0CPD5XTDZMh22BQ7h3k3B7t8TiSbw,12644
254
- tico-0.1.0.dev250909.dist-info/METADATA,sha256=udUCPXehe7bxZ27PQKpcxub4Q6VSoaoEmckvpdx5FPo,8450
255
- tico-0.1.0.dev250909.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
256
- tico-0.1.0.dev250909.dist-info/entry_points.txt,sha256=kBKYSS_IYrSXmUYevmmepqIVPScq5vF8ulQRu3I_Zf0,59
257
- tico-0.1.0.dev250909.dist-info/top_level.txt,sha256=oqs7UPoNSKZEwqsX8B-KAWdQwfAa7i60pbxW_Jk7P3w,5
258
- tico-0.1.0.dev250909.dist-info/RECORD,,
254
+ tico-0.1.0.dev250910.dist-info/LICENSE,sha256=kp4JLII7bzRhPb0CPD5XTDZMh22BQ7h3k3B7t8TiSbw,12644
255
+ tico-0.1.0.dev250910.dist-info/METADATA,sha256=N9SJ_U0Q1K0F1TYTOANZjd26WXZCigDaeWFihGfsYn0,8450
256
+ tico-0.1.0.dev250910.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
257
+ tico-0.1.0.dev250910.dist-info/entry_points.txt,sha256=kBKYSS_IYrSXmUYevmmepqIVPScq5vF8ulQRu3I_Zf0,59
258
+ tico-0.1.0.dev250910.dist-info/top_level.txt,sha256=oqs7UPoNSKZEwqsX8B-KAWdQwfAa7i60pbxW_Jk7P3w,5
259
+ tico-0.1.0.dev250910.dist-info/RECORD,,