Skip to content

Commit

Permalink
Merge a4d4be8 into 4525574
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Novikov authored Nov 7, 2019
2 parents 4525574 + a4d4be8 commit 6cc1ea1
Show file tree
Hide file tree
Showing 39 changed files with 47 additions and 42 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ dist: trusty
language: python
python:
- "2.7"
- "3.4"
- "3.5"
- "3.6"
env:
matrix:
- TF_VERSION=1.12.2
- TF_VERSION=1.13.2
- TF_VERSION=1.14
- TF_VERSION=1.15
- TF_VERSION=2.0
# command to install dependencies
install:
- pip install --upgrade pip
- pip install tensorflow==$TF_VERSION
- pip install coveralls
# command to run tests
Expand Down
2 changes: 1 addition & 1 deletion docs/benchmark/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import numpy as np
import pickle
import argparse
import tensorflow as tf
import tensorflow.compat.v1 as tf
import tmp_benchmark_config

from tensorflow.python.client import device_lib
Expand Down
2 changes: 1 addition & 1 deletion docs/benchmark/tmp_benchmark_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
Copied with minor modifications from
https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/platform/benchmark.py
"""
import tensorflow as tf
import tensorflow.compat.v1 as tf


def import_benchmark_config():
Expand Down
2 changes: 1 addition & 1 deletion docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Installation
============

T3f assumes you have Python 2.7, 3.4, 3.5, or 3.6 and a working TensorFlow installation (tested versions are from 1.12 to 1.14, see here_ for TF installation instructions).
T3f assumes you have Python 2.7, 3.5 or 3.6 and a working TensorFlow installation (tested versions are from 1.13 to 2.0 (TF 2.0 is only supported in compat.v1 mode), see here_ for TF installation instructions).

.. _here: https://www.tensorflow.org/install/

Expand Down
3 changes: 2 additions & 1 deletion docs/quick_start.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"outputs": [],
"source": [
"import numpy as np\n",
"import tensorflow as tf\n",
"import tensorflow.compat.v1 as tf\n",
"tf.disable_v2_behavior()\n",
"tf.enable_eager_execution()\n",
"try:\n",
" import t3f\n",
Expand Down
3 changes: 2 additions & 1 deletion docs/tutorials/riemannian.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
"metadata": {},
"outputs": [],
"source": [
"import tensorflow as tf\n",
"import tensorflow.compat.v1 as tf\n",
"tf.disable_v2_behavior()\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"tf.set_random_seed(0)\n",
Expand Down
3 changes: 2 additions & 1 deletion docs/tutorials/tensor_completion.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
"outputs": [],
"source": [
"import numpy as np\n",
"import tensorflow as tf\n",
"import tensorflow.compat.v1 as tf\n",
"tf.disable_v2_behavior()\n",
"tf.set_random_seed(0)\n",
"np.random.seed(0)\n",
"%matplotlib inline\n",
Expand Down
3 changes: 2 additions & 1 deletion docs/tutorials/tensor_nets.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@
"cell_type": "code",
"source": [
"import numpy as np\n",
"import tensorflow as tf\n",
"import tensorflow.compat.v1 as tf\n",
"tf.disable_v2_behavior()\n",
"import keras.backend as K\n",
"\n",
"tf.set_random_seed(0)\n",
Expand Down
2 changes: 1 addition & 1 deletion t3f/approximate.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import itertools
import numpy as np
import tensorflow as tf
import tensorflow.compat.v1 as tf
from t3f.tensor_train_batch import TensorTrainBatch
from t3f import decompositions
from t3f import batch_ops
Expand Down
3 changes: 2 additions & 1 deletion t3f/approximate_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import numpy as np
import tensorflow as tf
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()

from t3f import ops
from t3f import approximate
Expand Down
4 changes: 2 additions & 2 deletions t3f/autodiff.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import tensorflow as tf
import tensorflow.compat.v1 as tf

from t3f import shapes
from t3f import decompositions
Expand Down Expand Up @@ -171,4 +171,4 @@ def hessian_vector_product(func, x, vector, name='t3f_hessian_vector_product',
grad_times_vec = tf.add_n(products)
second_cores_grad = tf.gradients(grad_times_vec, deltas)
final_deltas = _enforce_gauge_conditions(second_cores_grad, left)
return riemannian.deltas_to_tangent_space(final_deltas, x, left, right)
return riemannian.deltas_to_tangent_space(final_deltas, x, left, right)
2 changes: 1 addition & 1 deletion t3f/autodiff_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import numpy as np
import tensorflow as tf
import tensorflow.compat.v1 as tf

from t3f import ops
from t3f import initializers
Expand Down
2 changes: 1 addition & 1 deletion t3f/batch_ops.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import itertools
import tensorflow as tf
import tensorflow.compat.v1 as tf

from t3f.tensor_train_base import TensorTrainBase
from t3f.tensor_train_batch import TensorTrainBatch
Expand Down
2 changes: 1 addition & 1 deletion t3f/batch_ops_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import numpy as np
import tensorflow as tf
import tensorflow.compat.v1 as tf

from t3f import ops
from t3f import batch_ops
Expand Down
2 changes: 1 addition & 1 deletion t3f/decompositions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import numpy as np
import tensorflow as tf
import tensorflow.compat.v1 as tf

from t3f.tensor_train import TensorTrain
from t3f.tensor_train_batch import TensorTrainBatch
Expand Down
2 changes: 1 addition & 1 deletion t3f/decompositions_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import numpy as np
import tensorflow as tf
import tensorflow.compat.v1 as tf

from t3f import ops
from t3f import shapes
Expand Down
2 changes: 1 addition & 1 deletion t3f/examples_tests.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Tests from the README examples and the paper."""

import tensorflow as tf
import tensorflow.compat.v1 as tf
import t3f

class ExamplesTest(tf.test.TestCase):
Expand Down
2 changes: 1 addition & 1 deletion t3f/initializers.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import numpy as np
import tensorflow as tf
import tensorflow.compat.v1 as tf

from t3f.tensor_train import TensorTrain
from t3f.tensor_train_batch import TensorTrainBatch
Expand Down
2 changes: 1 addition & 1 deletion t3f/initializers_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import numpy as np
import tensorflow as tf
import tensorflow.compat.v1 as tf

from t3f import initializers
from t3f import ops
Expand Down
2 changes: 1 addition & 1 deletion t3f/kronecker.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import tensorflow as tf
import tensorflow.compat.v1 as tf

from t3f.tensor_train import TensorTrain
from t3f.tensor_train_batch import TensorTrainBatch
Expand Down
2 changes: 1 addition & 1 deletion t3f/kronecker_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import numpy as np
import tensorflow as tf
import tensorflow.compat.v1 as tf

from t3f.tensor_train import TensorTrain
from t3f.tensor_train_batch import TensorTrainBatch
Expand Down
2 changes: 1 addition & 1 deletion t3f/nn.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from tensorflow.keras.layers import Layer
from tensorflow.keras.layers import Activation
import t3f
import tensorflow as tf
import tensorflow.compat.v1 as tf


class KerasDense(Layer):
Expand Down
2 changes: 1 addition & 1 deletion t3f/nn_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import numpy as np
import tensorflow as tf
import tensorflow.compat.v1 as tf

from t3f import nn

Expand Down
2 changes: 1 addition & 1 deletion t3f/ops.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import tensorflow as tf
import tensorflow.compat.v1 as tf
import numpy as np
from t3f.tensor_train_base import TensorTrainBase
from t3f.tensor_train import TensorTrain
Expand Down
2 changes: 1 addition & 1 deletion t3f/ops_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import numpy as np
import tensorflow as tf
import tensorflow.compat.v1 as tf

from t3f.tensor_train import TensorTrain
from t3f.tensor_train_batch import TensorTrainBatch
Expand Down
2 changes: 1 addition & 1 deletion t3f/regularizers.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import numbers

import tensorflow as tf
import tensorflow.compat.v1 as tf

from t3f import ops

Expand Down
2 changes: 1 addition & 1 deletion t3f/riemannian.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import tensorflow as tf
import tensorflow.compat.v1 as tf

from t3f.tensor_train import TensorTrain
from t3f.tensor_train_batch import TensorTrainBatch
Expand Down
2 changes: 1 addition & 1 deletion t3f/riemannian_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import numpy as np
import tensorflow as tf
import tensorflow.compat.v1 as tf

from t3f.tensor_train import TensorTrain
from t3f import ops
Expand Down
2 changes: 1 addition & 1 deletion t3f/shapes.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import numpy as np
import tensorflow as tf
import tensorflow.compat.v1 as tf


# TODO: test all these functions.
Expand Down
2 changes: 1 addition & 1 deletion t3f/shapes_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import tensorflow as tf
import tensorflow.compat.v1 as tf

from t3f import initializers
from t3f import shapes
Expand Down
2 changes: 1 addition & 1 deletion t3f/tensor_train.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import tensorflow as tf
import tensorflow.compat.v1 as tf

from t3f.tensor_train_base import TensorTrainBase
from t3f import shapes
Expand Down
2 changes: 1 addition & 1 deletion t3f/tensor_train_base.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from functools import reduce
import numpy as np
import tensorflow as tf
import tensorflow.compat.v1 as tf


# TODO: check the methods of _TensorLike
Expand Down
2 changes: 1 addition & 1 deletion t3f/tensor_train_batch.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import numpy as np
import tensorflow as tf
import tensorflow.compat.v1 as tf

from t3f.tensor_train_base import TensorTrainBase
from t3f.tensor_train import TensorTrain
Expand Down
2 changes: 1 addition & 1 deletion t3f/tensor_train_batch_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import numpy as np
import tensorflow as tf
import tensorflow.compat.v1 as tf

from t3f import initializers
from t3f import ops
Expand Down
2 changes: 1 addition & 1 deletion t3f/tensor_train_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import numpy as np
import tensorflow as tf
import tensorflow.compat.v1 as tf

from t3f import tensor_train
from t3f import initializers
Expand Down
2 changes: 1 addition & 1 deletion t3f/utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import numpy as np
import tensorflow as tf
import tensorflow.compat.v1 as tf


# TODO: substitute with native implementation when it's ready.
Expand Down
2 changes: 1 addition & 1 deletion t3f/utils_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import numpy as np
import tensorflow as tf
import tensorflow.compat.v1 as tf

from t3f import utils

Expand Down
2 changes: 1 addition & 1 deletion t3f/variables.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import tensorflow as tf
import tensorflow.compat.v1 as tf

from t3f.tensor_train import TensorTrain
from t3f.tensor_train_batch import TensorTrainBatch
Expand Down
2 changes: 1 addition & 1 deletion t3f/variables_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import numpy as np
import tensorflow as tf
import tensorflow.compat.v1 as tf

from t3f import variables
from t3f import ops
Expand Down

0 comments on commit 6cc1ea1

Please sign in to comment.