| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
parent directory.. | ||||
Construct and execute TensorFlow graphs in Go.
WARNING: The API defined in this package is not stable and can change without notice. The same goes for the package path: (github.com/tensorflow/tensorflow/tensorflow/go).
Refer to Installing TensorFlow for Go
If the "Quickstart" instructions above do not work (perhaps the release archives are not available for your operating system or architecture, or you're using a different version of CUDA/cuDNN), then the TensorFlow C library must be built from source.
Environment to build TensorFlow from source code (Linux or OS X). If you don't need GPU support, then try the following:
sudo apt-get install python swig python-numpy # Linux
brew install swig # OS X with homebrewDownload the source code
go get -d github.com/tensorflow/tensorflow/tensorflow/goBuild the TensorFlow C library:
cd ${GOPATH}/src/github.com/tensorflow/tensorflow
./configure
bazel build --config opt //tensorflow:libtensorflow.soThis can take a while (tens of minutes, more if also building for GPU).
Make libtensorflow.so available to the linker. This can be done by either:
a. Copying it to a system location, e.g.,
sudo cp ${GOPATH}/src/github.com/tensorflow/tensorflow/bazel-bin/tensorflow/libtensorflow.so /usr/local/libOR
b. Setting environment variables:
export LIBRARY_PATH=${GOPATH}/src/github.com/tensorflow/tensorflow/bazel-bin/tensorflow
# Linux
export LD_LIBRARY_PATH=${GOPATH}/src/github.com/tensorflow/tensorflow/bazel-bin/tensorflow
# OS X
export DYLD_LIBRARY_PATH=${GOPATH}/src/github.com/tensorflow/tensorflow/bazel-bin/tensorflowBuild and test:
go test github.com/tensorflow/tensorflow/tensorflow/goGo functions corresponding to TensorFlow operations are generated in op/wrappers.go. To regenerate them:
Prerequisites:
go generate github.com/tensorflow/tensorflow/tensorflow/go/opUse stackoverflow and/or Github issues.
Contributions are welcome. If making any signification changes, probably best to discuss on a Github issue before investing too much time. Github pull requests are used for contributions.
| Back | FazBrowse Home | New Git URL |