{"action":"created","issue":{"url":"https://api.github.com/repos/tensorflow/tensorflow/issues/20368","repository_url":"https://api.github.com/repos/tensorflow/tensorflow","labels_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/20368/labels{/name}","comments_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/20368/comments","events_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/20368/events","html_url":"https://github.com/tensorflow/tensorflow/issues/20368","id":336459957,"node_id":"MDU6SXNzdWUzMzY0NTk5NTc=","number":20368,"title":"Using new tensorflow op for matrix exponential in a c++ library that already uses tensorflow as third party","user":{"login":"Ceveloper","id":38587456,"node_id":"MDQ6VXNlcjM4NTg3NDU2","avatar_url":"https://avatars0.githubusercontent.com/u/38587456?v=4","gravatar_id":"","url":"https://api.github.com/users/Ceveloper","html_url":"https://github.com/Ceveloper","followers_url":"https://api.github.com/users/Ceveloper/followers","following_url":"https://api.github.com/users/Ceveloper/following{/other_user}","gists_url":"https://api.github.com/users/Ceveloper/gists{/gist_id}","starred_url":"https://api.github.com/users/Ceveloper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ceveloper/subscriptions","organizations_url":"https://api.github.com/users/Ceveloper/orgs","repos_url":"https://api.github.com/users/Ceveloper/repos","events_url":"https://api.github.com/users/Ceveloper/events{/privacy}","received_events_url":"https://api.github.com/users/Ceveloper/received_events","type":"User","site_admin":false},"labels":[{"id":473184161,"node_id":"MDU6TGFiZWw0NzMxODQxNjE=","url":"https://api.github.com/repos/tensorflow/tensorflow/labels/type:support","name":"type:support","color":"b60205","default":false}],"state":"open","locked":false,"assignee":{"login":"robieta","id":13089297,"node_id":"MDQ6VXNlcjEzMDg5Mjk3","avatar_url":"https://avatars0.githubusercontent.com/u/13089297?v=4","gravatar_id":"","url":"https://api.github.com/users/robieta","html_url":"https://github.com/robieta","followers_url":"https://api.github.com/users/robieta/followers","following_url":"https://api.github.com/users/robieta/following{/other_user}","gists_url":"https://api.github.com/users/robieta/gists{/gist_id}","starred_url":"https://api.github.com/users/robieta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robieta/subscriptions","organizations_url":"https://api.github.com/users/robieta/orgs","repos_url":"https://api.github.com/users/robieta/repos","events_url":"https://api.github.com/users/robieta/events{/privacy}","received_events_url":"https://api.github.com/users/robieta/received_events","type":"User","site_admin":false},"assignees":[{"login":"robieta","id":13089297,"node_id":"MDQ6VXNlcjEzMDg5Mjk3","avatar_url":"https://avatars0.githubusercontent.com/u/13089297?v=4","gravatar_id":"","url":"https://api.github.com/users/robieta","html_url":"https://github.com/robieta","followers_url":"https://api.github.com/users/robieta/followers","following_url":"https://api.github.com/users/robieta/following{/other_user}","gists_url":"https://api.github.com/users/robieta/gists{/gist_id}","starred_url":"https://api.github.com/users/robieta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robieta/subscriptions","organizations_url":"https://api.github.com/users/robieta/orgs","repos_url":"https://api.github.com/users/robieta/repos","events_url":"https://api.github.com/users/robieta/events{/privacy}","received_events_url":"https://api.github.com/users/robieta/received_events","type":"User","site_admin":false}],"milestone":null,"comments":6,"created_at":"2018-06-28T03:27:51Z","updated_at":"2018-09-30T12:54:16Z","closed_at":null,"author_association":"NONE","body":"### System information\r\n- **Have I written custom code**: I'm using ZeroOut CPU versionfrom https://github.com/MatteoRagni/tf.ZeroOut.gpu\r\n- **OS Platform and Distribution (e.g., Linux Ubuntu 16.04)**: Linux Ubuntu 16.04 LTS\r\n- **TensorFlow installed from**: source\r\n- **TensorFlow version** : 1.8.0\r\n- **Python version**: Python 3.5.2\r\n- **Bazel version (if compiling from source)**: 0.14.1\r\n- **GCC/Compiler version (if compiling from source)**: gcc 5.4.0,  cmake 3.5.1\r\n- **CUDA/cuDNN version**: release 9.0, V9.0.176\r\n- **GPU model and memory**: GeForce GT 730/PCIe/SSE2\r\n- **Exact command to reproduce**: N/A\r\n\r\n\r\nHallo to everyone! That's my first time asking a question in tensorflow. I will try my best to formulate my question properly.\r\n\r\nMy plan is: \r\n\r\n - implement a new tensorflow GPU op for the matrix exponential,using Eigen unsupported MatrixFunctions or the already existing tensorflow matrix exponential op\r\n - add the gradient\r\n - use the new op in a c++ library, which already uses tensorflow as third party.\r\n\r\nI have started from the basics, and I realized that I don't know how to use my custom operation in c++. I registered the ZeroOut op for cpu from tensorflow c++ tutorial as in https://github.com/MatteoRagni/tf.ZeroOut.gpu but now I don't know how to use that in my c++ code. \r\n\r\nI tried to add the ZeroOut.so file to my lib as shared library, but it didn't work. Maybe I'm doing something wrong? My CMakeList.txt is attached. And including  ZeroOut.cpp in my c++ files hasn't make any difference until now.\r\nI looked in tensorflow documentation, stackoverflow and the internet but I couln't find an answer to my questions. Hopefully I didn't miss anything.\r\n\r\nCan you help me? Maybe giving an example of the required CMakeList.txt, even if not related to mine?\r\n\r\nSpeaking about my general plan, I would also like to have some advices from more experienced programmers. I know tensorflow has a matrix exponential op, but as far as I know it doesn't work for GPU (see #15465) and has no gradient implementation. Should I add this features to the existing op rather than registering a new one? And what about using Eigen unsupported MatrixFunctions in a new user op?\r\n\r\n### Source code / logs\r\nHere is my CMakeList.txt, which also creates the whole library I'm working with:\r\n\r\n    cmake_minimum_required(VERSION 2.8)\r\n    project(Project1)\r\n\r\n    set(CMAKE_BUILD_TYPE \"Release\") # Debug Release\r\n    set(CMAKE_CXX_FLAGS_RELEASE \"$ENV{CXXFLAGS} -std=c++14 -O3 -Wall                 -fopenmp\")\r\n    SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)\r\n\r\n    #-------------path of 3rd party libraries-------------\r\n    # special libs.\r\n    find_package(Boost COMPONENTS filesystem iostreams regex)\r\n    find_package(FFTW)\r\n    find_package(NLopt)\r\n    find_package(HDF5 COMPONENTS CXX)\r\n\r\n    set(EXTERN_LIB_ROOT ${PROJECT_SOURCE_DIR}/3rd-party)\r\n\r\n    set(TENSORFLOW_ROOT /.../tensorflow)\r\n    set(TF_INCLUDE_DIRS \"${TENSORFLOW_ROOT}\" \"${TENSORFLOW_ROOT}/bazel-  genfiles\" \"${TENSORFLOW_ROOT}/bazel-tensorflow/external/protobuf_archive/src\")\r\n\r\n    # lib dirs.\r\n    set(LUA_LIBRARIES \"${EXTERN_LIB_ROOT}/lua/liblua53.so\") #5.3.4\r\n    set(LINENOISE_LIBRARIES \"${EXTERN_LIB_ROOT}/linenoise-ng/build/liblinenoise.so\")\r\n    set(YACAS_LIBRARIES \"${EXTERN_LIB_ROOT}/yacas/cyacas/libyacas/build/libyacas.so\")\r\n\r\n\r\n    set(TF_LIBRARIES ${TENSORFLOW_ROOT}/bazel-bin/tensorflow/libtensorflow_cc.so\r\n        ${TENSORFLOW_ROOT}/tensorflow/core/user_ops/tf.ZeroOut.gpu-master/zero_out.so) \r\n    #-------------ssl headers-------------\r\n    include_directories(${PROJECT_SOURCE_DIR}/src\r\n        ${EXTERN_LIB_ROOT}/eigen\r\n        ${EXTERN_LIB_ROOT}/gnuplot-iostream\r\n        ${EXTERN_LIB_ROOT}/\r\n        ${EXTERN_LIB_ROOT}/linenoise-ng/include\r\n        ${EXTERN_LIB_ROOT}/yacas/cyacas/libyacas/include\r\n        ${EXTERN_LIB_ROOT}/lua/src\r\n        ${NLOPT_INCLUDE_DIRS}\r\n        ${FFTW_INCLUDES}\r\n        ${TF_INCLUDE_DIRS}\r\n        ${Boost_INCLUDE_DIRS}\r\n        ${HDF5_INCLUDE_DIRS}\r\n        ${TENSORFLOW_ROOT}) \r\n\r\n    option(BUILD_SHARED_LIBS \"build shared library\" ON)\r\n    set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)\r\n\r\n    #-------------ssl kernel lib-------------\r\n    file(GLOB_RECURSE _src_list\r\n        LIST_DIRECTORIES false\r\n        RELATIVE \"${CMAKE_CURRENT_SOURCE_DIR}\" \"${PROJECT_SOURCE_DIR}/src/*.h\" \"${PROJECT_SOURCE_DIR}/src/*.cpp\" \"\")\r\n\r\n    add_library(ssl SHARED ${_src_list})\r\n\r\n    set(SSL_LIBRARIES ${TF_LIBRARIES} ${LUA_LIBRARIES} ${Boost_LIBRARIES}     ${NLOPT_LIBRARIES} ${FFTW_LIBRARIES} ${LINENOISE_LIBRARIES} ${YACAS_LIBRARIES} ${HDF5_CXX_LIBRARIES}) #${TF_LIBRARIES}\r\n\r\n    target_link_libraries(ssl ${SSL_LIBRARIES} dl)\r\n\r\n    add_executable(Project1 main.cpp)\r\n    target_link_libraries(Project1 ssl)\r\n"},"comment":{"url":"https://api.github.com/repos/tensorflow/tensorflow/issues/comments/425719006","html_url":"https://github.com/tensorflow/tensorflow/issues/20368#issuecomment-425719006","issue_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/20368","id":425719006,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNTcxOTAwNg==","user":{"login":"tensorflowbutler","id":28546240,"node_id":"MDQ6VXNlcjI4NTQ2MjQw","avatar_url":"https://avatars2.githubusercontent.com/u/28546240?v=4","gravatar_id":"","url":"https://api.github.com/users/tensorflowbutler","html_url":"https://github.com/tensorflowbutler","followers_url":"https://api.github.com/users/tensorflowbutler/followers","following_url":"https://api.github.com/users/tensorflowbutler/following{/other_user}","gists_url":"https://api.github.com/users/tensorflowbutler/gists{/gist_id}","starred_url":"https://api.github.com/users/tensorflowbutler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tensorflowbutler/subscriptions","organizations_url":"https://api.github.com/users/tensorflowbutler/orgs","repos_url":"https://api.github.com/users/tensorflowbutler/repos","events_url":"https://api.github.com/users/tensorflowbutler/events{/privacy}","received_events_url":"https://api.github.com/users/tensorflowbutler/received_events","type":"User","site_admin":false},"created_at":"2018-09-30T12:54:16Z","updated_at":"2018-09-30T12:54:16Z","author_association":"MEMBER","body":"Nagging Assignee @robieta: It has been 76 days with no activity and this issue has an assignee. Please update the label and/or status accordingly."}}
{"actor":{"display_login":"tensorflowbutler"}}