def _oper_gpu(cls, x, w): norm = rm.sqrt(rm.sum(x * x, axis=1, keepdims=True)) + 1e-5 z = (x / norm) * w ret = cls._create_node(get_gpu(z)) ret.attrs._norm = norm ret.attrs._x = x ret.attrs._w = w return ret
def func4(node): return sum(rm.sqrt(node) + rm.sqrt(node))
def func3(node): return sum(rm.sqrt(node) * 3 + 15)
def func2(node): return sum(rm.sqrt(node) + 10)
def func1(node): return sum(rm.sqrt(node))