diff --git a/examples/python/tensorflow/CMakeLists.txt b/examples/python/tensorflow/CMakeLists.txt index 6c8a6f008..652c16b90 100644 --- a/examples/python/tensorflow/CMakeLists.txt +++ b/examples/python/tensorflow/CMakeLists.txt @@ -7,4 +7,9 @@ if(${TensorFlow_FOUND}) add_definitions(-D_GLIBCXX_USE_CXX11_ABI=${TF_ABI}) add_library(tf_blocksparse SHARED dot.cpp) target_link_libraries(tf_blocksparse tensorflow_framework triton) + add_custom_command( + TARGET tf_blocksparse POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy + ${CMAKE_CURRENT_SOURCE_DIR}/run.py + ${CMAKE_CURRENT_BINARY_DIR}/run.py) endif() diff --git a/examples/python/tensorflow/run.py b/examples/python/tensorflow/run.py index 3e8f78f31..0e0a51b43 100644 --- a/examples/python/tensorflow/run.py +++ b/examples/python/tensorflow/run.py @@ -3,7 +3,7 @@ import tensorflow as tf import numpy as np from time import time data_files_path = tf.resource_loader.get_data_files_path() -library_dir = '/home/philippe/development/triton/build/examples/python/tensorflow' +library_dir = os.path.dirname(os.path.realpath(__file__)) module = tf.load_op_library(os.path.join(library_dir, 'libtf_blocksparse.so')) M, N, K = 256,256,256