Skip to content

Include C and C++ APIs with binary distributions #18360

@peastman

Description

@peastman

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow): Yes
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Any
  • TensorFlow installed from (source or binary): see below
  • TensorFlow version (use command below): Any
  • Python version: Any
  • Bazel version (if compiling from source):
  • GCC/Compiler version (if compiling from source):
  • CUDA/cuDNN version:
  • GPU model and memory:
  • Exact command to reproduce:

When you install a precompiled Tensorflow binary with pip or conda, it doesn't include the C and C++ interfaces. To use it from those languages, you need to compile Tensorflow for source and build a special version of it that includes the needed API (see #2412). I suggest including them in the standard binaries. This would have multiple benefits.

First, it would make development in other languages much easier. You could just pip install tensorflow and link against the library it installed. Having to build a special version of Tensorflow from source adds an unnecessary barrier to getting started.

Second, it would eliminate a problem that so far I've been unable to resolve. I want to create a C++ library that uses Tensorflow. That library will be usable directly from C++, but I'll also use SWIG to create a Python wrapper for it. For example, a user should be able to write Python code to build a Graph, then pass it directly to my library.

That won't work right now, because there are two separate versions of Tensorflow involved, one that Python is linked against and a different one that my library is linked against. When the user is building a Graph in Python, they're working with one Tensorflow library. But when they try to pass it to my library, they're suddenly switching to a completely different copy of Tensorflow, so it doesn't have access to memory allocated by the first copy. I haven't found any solution to this problem.

Metadata

Metadata

Assignees

Labels

comp:runtimec++ runtime, performance issues (cpu)staleThis label marks the issue/pr stale - to be closed automatically if no activitystat:awaiting responseStatus - Awaiting response from authorstat:community supportStatus - Community Supporttype:featureFeature requests

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions