Repository: google/TensorNetwork

Issue:
tensorflow 2.2.0 breaks our build
It seems that tensorflow 2.2.0 breaks our build, at least it does so on my platform.
We should also bump versions of jax and jaxlib in requirements_travix.txt, there was a bug
in jax.numpy.qr on macOS that got only recently fixed.



Discussion:

Resolving patch:
diff --git a/tensornetwork/backends/tensorflow/tensorflow_backend.py b/tensornetwork/backends/tensorflow/tensorflow_backend.py
--- a/tensornetwork/backends/tensorflow/tensorflow_backend.py
+++ b/tensornetwork/backends/tensorflow/tensorflow_backend.py
@@ -161,6 +161,7 @@ def random_uniform(self,
 
     dtype = dtype if dtype is not None else tf.float64
     if (dtype is tf.complex128) or (dtype is tf.complex64):
+      #pylint: disable=unexpected-keyword-arg
       return tf.complex(
           tf.random.uniform(
               shape=shape,
@@ -173,6 +174,7 @@ def random_uniform(self,
               maxval=boundaries[1],
               dtype=dtype.real_dtype))
     tf.random.set_seed(10)
+    #pylint: disable=unexpected-keyword-arg
     a = tf.random.uniform(
         shape=shape, minval=boundaries[0], maxval=boundaries[1], dtype=dtype)
     return a
diff --git a/tensornetwork/tn_keras/dense.py b/tensornetwork/tn_keras/dense.py
--- a/tensornetwork/tn_keras/dense.py
+++ b/tensornetwork/tn_keras/dense.py
@@ -1,5 +1,5 @@
 import tensorflow as tf
-from tensorflow.keras.layers import Layer # type: ignore
+from tensorflow.keras.layers import Layer  # type: ignore
 from tensorflow.keras import activations
 from tensorflow.keras import initializers
 from typing import List, Optional, Text, Tuple
@@ -71,14 +71,16 @@ def build(self, input_shape: List[int]) -> None:
       raise ValueError('The last dimension of the inputs to `Dense` '
                        'should be defined. Found `None`.')
 
-    self.a_var = self.add_weight(name='a',
-                                 shape=(input_shape[-1], self.decomp_size),
-                                 trainable=True,
-                                 initializer=self.kernel_initializer)
-    self.b_var = self.add_weight(name='b',
-                                 shape=(self.decomp_size, self.output_dim),
-                                 trainable=True,
-                                 initializer=self.kernel_initializer)
+    self.a_var = self.add_weight(
+        name='a',
+        shape=(input_shape[-1], self.decomp_size),
+        trainable=True,
+        initializer=self.kernel_initializer)
+    self.b_var = self.add_weight(
+        name='b',
+        shape=(self.decomp_size, self.output_dim),
+        trainable=True,
+        initializer=self.kernel_initializer)
     self.bias_var = self.add_weight(
         name='bias',
         shape=(self.output_dim,),
@@ -86,7 +88,7 @@ def build(self, input_shape: List[int]) -> None:
         initializer=self.bias_initializer) if self.use_bias else None
     super(DenseDecomp, self).build(input_shape)
 
-  def call(self, inputs: tf.Tensor) -> tf.Tensor:
+  def call(self, inputs: tf.Tensor, **kwargs) -> tf.Tensor:  # pylint: disable=unused-argument
 
     def f(x: tf.Tensor, a_var: tf.Tensor, b_var: tf.Tensor, use_bias: bool,
           bias_var: tf.Tensor) -> tf.Tensor:


Test patch: