Skip to content

Supports for local functions in translator #96

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Feb 19, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix ut
  • Loading branch information
xadupre committed Feb 19, 2025
commit 67eb1c25ad7d1d5d69a20695c8206a614c732dec
18 changes: 9 additions & 9 deletions _unittests/ut_translate_api/test_translate_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def light_api(
op: "GraphBuilder",
X: "FLOAT[]",
):
Y = op.Exp(X)
Y = op.Exp(X, outputs=['Y'])
op.Identity(Y, outputs=["Y"])
return Y

Expand All @@ -57,7 +57,7 @@ def light_api(
op: "GraphBuilder",
X: "FLOAT[]", # noqa: F722
):
Y = op.Exp(X)
Y = op.Exp(X, outputs=["Y"])
op.Identity(Y, outputs=["Y"])
return Y

Expand Down Expand Up @@ -93,8 +93,8 @@ def light_api(
X: "FLOAT[]",
):
r = np.array([-1, 1], dtype=np.int64)
r0_0 = op.Reshape(X, r)
Y = op.Transpose(r0_0, perm=[1, 0])
r0_0 = op.Reshape(X, r, outputs=['r0_0'])
Y = op.Transpose(r0_0, perm=[1, 0], outputs=['Y'])
op.Identity(Y, outputs=["Y"])
return Y

Expand Down Expand Up @@ -148,7 +148,7 @@ def light_api(
op: "GraphBuilder",
X: "FLOAT[]",
):
Y = op.Exp(X)
Y = op.Exp(X, outputs=['Y'])
op.Identity(Y, outputs=["Y"])
return Y

Expand Down Expand Up @@ -240,8 +240,8 @@ def example(
A: "FLOAT[, ]",
B: "FLOAT[, ]",
):
Y1 = op.LinearRegression(X, A, B, domain='custom')
Y = op.Abs(Y1)
Y1 = op.LinearRegression(X, A, B, domain='custom', outputs=['Y1'])
Y = op.Abs(Y1, outputs=['Y'])
op.Identity(Y, outputs=["Y"])
return Y

Expand All @@ -252,8 +252,8 @@ def make_custom_LinearRegression(g: "GraphBuilder"):
a = gr.make_tensor_input('a')
b = gr.make_tensor_input('b')
op = gr.op
xa = op.MatMul(x, a)
y = op.Add(xa, b)
xa = op.MatMul(x, a, outputs=['xa'])
y = op.Add(xa, b, outputs=['y'])
gr.make_tensor_output(y)
g.add_function(builder=gr)
return gr
Expand Down
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy