This commit is contained in:
Tianqi Chen 2018-01-24 16:37:47 -08:00 коммит произвёл GitHub
Родитель 8902ae7bb7
Коммит 56c4eeb3a2
1 изменённых файлов: 20 добавлений и 20 удалений

Просмотреть файл

@ -102,6 +102,12 @@ for example.
# same machine, for demonstration. This line can be omitted if we # same machine, for demonstration. This line can be omitted if we
# started an remote server. # started an remote server.
# #
from __future__ import absolute_import, print_function
import tvm
import numpy as np
from tvm.contrib import rpc, util
server = rpc.Server(host='0.0.0.0', port=9090, use_popen=True) server = rpc.Server(host='0.0.0.0', port=9090, use_popen=True)
###################################################################### ######################################################################
@ -114,12 +120,6 @@ server = rpc.Server(host='0.0.0.0', port=9090, use_popen=True)
# #
# Here we will declare a simple kernel with TVM on the local machine: # Here we will declare a simple kernel with TVM on the local machine:
from __future__ import absolute_import, print_function
import tvm
import numpy as np
from tvm.contrib import rpc, util
n = tvm.convert(1024) n = tvm.convert(1024)
A = tvm.placeholder((n,), name='A') A = tvm.placeholder((n,), name='A')
B = tvm.compute(A.shape, lambda *i: A(*i) + 1.0, name='B') B = tvm.compute(A.shape, lambda *i: A(*i) + 1.0, name='B')