示例#1
0
 def single_state_reshape_same_state(inp: dace.float64[9],
                                     target_shape: dace.int64[2]):
     reshaped = dace.define_local([3, 3], dace.float64)
     donnx.ONNXReshape(data=inp, shape=target_shape, reshaped=reshaped)
     Zl = dace.elementwise(lambda x: log(x + 1), reshaped)
     S = np.sum(Zl)
     return S
示例#2
0
def middle_sqrt_with_intermediate(Y: dace.float32[3, 3]):
    intermediate = dace.define_local([3, 3], dace.float32)
    W = dace.define_local([3, 3], dace.float32)
    intermediate[:] = dace.elementwise(lambda x: sqrt(x), Y)
    inner_sdfg_with_intermediate(intermediate, W)
    Z = np.sum(W)
    return Z
示例#3
0
def outer_sqrt_with_intermediate(Y: dace.float32[3, 3]):
    intermediate = dace.define_local([3, 3], dace.float32)
    W = dace.define_local([3, 3], dace.float32)
    intermediate[:] = dace.elementwise(lambda x: sqrt(x), Y)
    W[:] = middle_sqrt_no_sum(intermediate)
    Z = np.sum(W)
    return Z
示例#4
0
    def dace_func(X: dace.float64[4, 5], Y: dace.float64[4, 3],
                  W: dace.float64[7, 4, 3]):

        Xt[:] = np.transpose(X)
        YW[:] = np.min(W, axis=0) * Y
        Z[:] = Xt @ YW

        Zl = dace.elementwise(lambda x: log(x + 1), Z)
        S = np.sum(Zl)
        return S
示例#5
0
 def add_reshape_grad_test_nested(inp: dace.float64[9],
                                  bias: dace.float64[3],
                                  target_shape: dace.int64[2],
                                  result: dace.float64):
     reshaped = dace.define_local([3, 3], dace.float64)
     added = inp + 1
     donnx.ONNXReshape(data=added, shape=target_shape, reshaped=reshaped)
     Z = reshaped * bias
     Zl = dace.elementwise(lambda x: log(x + 1), Z)
     result[:] = np.sum(Zl)
示例#6
0
    def reduce_node_1_axis_and_none_axis(X: dace.float32[4, 5],
                                         Y: dace.float32[4, 3],
                                         W: dace.float32[7, 4, 3]):

        Xt[:] = np.transpose(X)
        YW[:] = np.sum(W, axis=0) * Y
        Z[:] = Xt @ YW

        Zl = dace.elementwise(lambda x: log(x + 1), Z)
        S = np.sum(Zl)
        return S
示例#7
0
 def prog(A: dace.float64[5, 3], B: dace.float64[5, 3]):
     dace.elementwise(lambda x: log(x), A, B)
示例#8
0
 def elementwise_cast(A: dace.float32[5, 3], B: dace.float64[5, 3]):
     dace.elementwise(lambda x: x, A, B)
示例#9
0
 def elementise_none(A: dace.float64[5, 3], B: dace.float64[5, 3]):
     B[:] = dace.elementwise(lambda x: log(x), A)
示例#10
0
 def prog(A: dace.float32[5, 3], B: dace.float64[5, 3]):
     dace.elementwise(lambda x: x, A, B)
示例#11
0
def inner_sdfg_with_intermediate(Z: dace.float32[3, 3], W: dace.float32[3, 3]):
    intermediate = dace.define_local([3, 3], dace.float32)
    intermediate[:] = dace.elementwise(lambda x: sqrt(x), Z)
    W[:] = dace.elementwise(lambda x: log(x), intermediate)
示例#12
0
def inner_sdfg(Z: dace.float32[3, 3], W: dace.float32[3, 3]):
    W[:] = dace.elementwise(lambda x: log(x), Z)
示例#13
0
 def prog(input, output):
     output[:] = dace.elementwise(lambda x: log(x), input)
示例#14
0
 def prog(X, Y):
     Y[:] = dace.elementwise(cast_lambda, X)
示例#15
0
 def prog(X, Y):
     Y[:] = dace.elementwise(tanh_lambda, X)
示例#16
0
 def prog(X, Y):
     Y[:] = dace.elementwise(lambda x: sqrt(x), X)