Skip to content

AliceLane/tensorfuse

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 

Repository files navigation

TensorFuse

Common interface for Theano, CGT, TensorFlow, and mxnet (experimental).

Installation

The recommended way to install this library is python setup.py develop.

Usage

The current API for TensorFuse is geared towards migrating existing Theano-based code to using CGT, TensorFlow. Therefore, if you have some code that uses Theano, you can simply change the import statements to

import tensorfuse as theano
import tensorfuse.tensor as T

Then (hopefully) your code can switch between Theano / CGT / TensorFlow easily. The choice is controlled by an environment variable TENSORFUSE_MODE, with valid values theano, cgt, tensorflow, or tf for abbreviation (if no environment variable is set, then it defaults to Theano). Therefore, to run the code in TensorFlow mode, you can either set the environment variable before running the script, or add the following to the beginning of the file:

import os
os.environ['TENSORFUSE_MODE'] = 'tensorflow' # or 'tf'

To run the code in CGT mode, do the following:

import os
os.environ['TENSORFUSE_MODE'] = 'cgt'

Running Benchmark

python tensorfuse/benchmark/run_benchmark.py tensorfuse/benchmark/simple_ops.py

About

Common interface for Theano, CGT, and TensorFlow

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%