예제 #1
0
def genTestData(name, inpShape, outShape):
    net = dn.load_net(name + '.cfg', '', 0)

    inp = np.random.standard_normal(inpShape).astype(np.float32)

    inpData = dn.c_array(dn.c_float, inp.flatten())
    pred = dn.predict(net, inpData)

    total = np.prod(outShape)
    out = np.zeros([total], np.float32)
    for i in range(total):
        out[i] = pred[i]
    out = out.reshape(outShape)

    np.save(name + '_in.npy', inp)
    np.save(name + '_out.npy', out)
def genTestData(name, inpShape, outShape):
    net = dn.load_net(name + '.cfg', '', 0)

    inp = np.random.standard_normal(inpShape).astype(np.float32)

    inpData = dn.c_array(dn.c_float, inp.flatten())
    pred = dn.predict(net, inpData)

    total = np.prod(outShape)
    out = np.zeros([total], np.float32)
    for i in range(total):
        out[i] = pred[i]
    out = out.reshape(outShape)

    np.save(name + '_in.npy', inp)
    np.save(name + '_out.npy', out)