오디오랑 이미지 전처리까지 전부 합해서 연산함수 150개 만듦

한 줄만 적으면 바로 GPU 가속 됨. 기존 자바 GPU 라이브러리들에 비하면 빛이 나는 간결함.

어떰? 넘파이 같음?



public static void main(String[] args){
    CuBridge cb = CuBridge.getInstance();

    Tensor ta = Tensor.randn(3, 3);
    Tensor tb = Tensor.randn(3, 3);

    cb.addI(ta, tb).printData();
    cb.subI(ta, tb).printData();
    cb.mulI(ta, tb).printData();
    cb.divI(ta, tb).printData();
}

=>
Tensor(shape=[3, 3]):
    [  0.700,  0.230, -0.627 ]
    [ -2.357, -2.373,  0.020 ]
    [ -1.518,  0.929,  0.039 ]
Tensor(shape=[3, 3]):
    [ -2.596, -0.129, -3.030 ]
    [  2.579, -0.051,  1.767 ]
    [ -1.984, -1.800,  0.475 ]
Tensor(shape=[3, 3]):
    [ -1.562,  0.009, -2.197 ]
    [ -0.274,  1.408, -0.780 ]
    [ -0.408, -0.594, -0.056 ]
Tensor(shape=[3, 3]):
    [ -0.575,  0.281, -1.522 ]
    [ -0.045,  1.044, -1.023 ]
    [ -7.517, -0.319, -1.180 ]