예제 #1
0
def test_gpu_node_elu(a):
    set_cuda_active(True)

    g1 = Variable(a)

    g3 = sum(rm.elu(g1))
    g = g3.grad()
    g_g1 = g.get(g1)
    g3.to_cpu()

    set_cuda_active(False)
    c3 = sum(rm.elu(g1))
    c = c3.grad()
    c_g1 = c.get(g1)

    close(g3, c3)
    close(c_g1, g_g1)
예제 #2
0
 def func(node):
     return sum(rm.elu(node))