This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tensorflow as tf | |
# Read the graph. | |
with tf.gfile.FastGFile('opt_graph.pb') as f: | |
graph_def = tf.GraphDef() | |
graph_def.ParseFromString(f.read()) | |
# Remove Const nodes. | |
for i in reversed(range(len(graph_def.node))): | |
if graph_def.node[i].op == 'Const': |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
Halide::Var x("x"), xo("xo"), xi("xi"); | |
Halide::Func f("f"); | |
f(x) = x + 777; | |
f.bound(x, 0, 16); | |
f.split(x, xo, xi, 8).gpu_threads(xi).gpu_blocks(xo); | |
f.output_buffer().dim(0).set_bounds(0, 16); | |
Halide::Target target = Halide::get_host_target(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.4.3) | |
project(test_halide CXX) | |
include_directories( | |
~/Halide/build/include | |
) | |
link_directories( | |
~/Halide/build/lib | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd ~/opencv/build | |
cmake -DCMAKE_BUILD_TYPE=RELEASE \ | |
-DWITH_OPENCL=NO \ | |
-DWITH_CUDA=NO \ | |
-DBUILD_TESTS=OFF \ | |
-DBUILD_PERF_TESTS=OFF \ | |
-DBUILD_opencv_aruco=OFF \ | |
-DBUILD_opencv_bgsegm=OFF \ | |
-DBUILD_opencv_bioinspired=OFF \ |
NewerOlder