Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save abadams/9881970d3c5e508139ba7a023260ea5f to your computer and use it in GitHub Desktop.
Save abadams/9881970d3c5e508139ba7a023260ea5f to your computer and use it in GitHub Desktop.
Type 1:
def fun(float(N) X, float(N) Y) -> (Z, W) {
tmp(i) = X(i) + 4
Z(i) = tmp(i)
W(i) = Y(i) + 4
}
Type 2:
def helper_fun(float(N) A) -> (B) {
B(i) = A(i) + 4
}
def fun(float(N) X, float(N) Y) -> (Z, W) {
W = helper_fun(X)
Z = helper_fun(Y)
}
Type 3:
def helper_fun(float A) -> (B) {
B = A + 4
}
def fun(float(N) X, float(N) Y) -> (Z, W) {
W(i) = helper_fun(X(i))
Z(i) = helper_fun(Y(i))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment