File: renaming.py

package info (click to toggle)
onnxscript 0.2.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 12,384 kB
  • sloc: python: 75,957; sh: 41; makefile: 6
file content (23 lines) | stat: -rw-r--r-- 468 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

from onnxscript.onnx_opset import opset15 as op
from onnxscript.onnx_types import FLOAT

# same variable assigned multiple times


def renaming(A: FLOAT["N"]) -> FLOAT["N"]:
    T = op.Abs(A)
    T = op.Neg(A)
    return T


# clash between generated-name and pre-existing name


def renaming2(A: FLOAT["N"]) -> FLOAT["N"]:
    T_0 = op.Relu(A)
    T = op.Abs(A)
    T = op.Neg(A)
    return T