Skip to content

Commit

Permalink
Add new import paths to mnist_tpu.py (tensorflow#4133)
Browse files Browse the repository at this point in the history
* Add new import paths to mnist_tpu.py

This adds new import paths to mnist_tpu.py so individuals can check out the git repository and run `python mnist_tpu.py` without finagling with python import search paths.

* Fix lint errors

* Add disable= to pylint instructions

* Remove parent path

* Update comments
  • Loading branch information
Frank Chen authored and Jishnu Mukhoti committed May 15, 2018
1 parent 0b68a97 commit 7bd3875
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions official/mnist/mnist_tpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,16 @@
from __future__ import division
from __future__ import print_function

import os
import sys

import tensorflow as tf # pylint: disable=g-bad-import-order

from official.mnist import dataset
from official.mnist import mnist
# For open source environment, add grandparent directory for import
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(sys.path[0]))))

from official.mnist import dataset # pylint: disable=wrong-import-position
from official.mnist import mnist # pylint: disable=wrong-import-position

# Cloud TPU Cluster Resolver flags
tf.flags.DEFINE_string(
Expand Down

0 comments on commit 7bd3875

Please sign in to comment.