aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/contrib/coder
diff options
context:
space:
mode:
authorGravatar Allen Lavoie <allenl@google.com>2018-06-22 14:40:52 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-06-22 14:43:27 -0700
commit4031d064542093868a82a924379da2dc739adbbd (patch)
treecb041fd014a07048133f9219a6718d8a2c6677f8 /tensorflow/contrib/coder
parent4b697277f39fc52edee36c9f89c4c4283a0f2bb9 (diff)
Remove hourglass imports for python/keras/engine/...
Previously there was python/keras/engine/__init__.py, which required every import of Layer (for example) to also import Network (since Python will not import a file in a directory without running its __init__.py file). I'm working on adding automatic attribute tracking to Checkpointable (and Network) and so need to insert things between Layer and Network. PiperOrigin-RevId: 201743850
Diffstat (limited to 'tensorflow/contrib/coder')
-rw-r--r--tensorflow/contrib/coder/python/layers/entropybottleneck.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/tensorflow/contrib/coder/python/layers/entropybottleneck.py b/tensorflow/contrib/coder/python/layers/entropybottleneck.py
index 0fbe3081af..0c997bd4fd 100644
--- a/tensorflow/contrib/coder/python/layers/entropybottleneck.py
+++ b/tensorflow/contrib/coder/python/layers/entropybottleneck.py
@@ -28,7 +28,7 @@ from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops
from tensorflow.python.framework import tensor_shape
-from tensorflow.python.keras import engine
+from tensorflow.python.keras.engine import base_layer
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import functional_ops
from tensorflow.python.ops import init_ops
@@ -40,7 +40,7 @@ from tensorflow.python.ops import variable_scope
from tensorflow.python.summary import summary
-class EntropyBottleneck(engine.Layer):
+class EntropyBottleneck(base_layer.Layer):
"""Entropy bottleneck layer.
This layer can be used to model the entropy (the amount of information
@@ -262,7 +262,7 @@ class EntropyBottleneck(engine.Layer):
self._range_coder_precision = int(range_coder_precision)
self._data_format = data_format
self._channel_axis(2) # trigger ValueError early
- self.input_spec = engine.InputSpec(min_ndim=2)
+ self.input_spec = base_layer.InputSpec(min_ndim=2)
@property
def init_scale(self):
@@ -357,7 +357,7 @@ class EntropyBottleneck(engine.Layer):
channels = input_shape[channel_axis].value
if channels is None:
raise ValueError("The channel dimension of the inputs must be defined.")
- self.input_spec = engine.InputSpec(
+ self.input_spec = base_layer.InputSpec(
ndim=input_shape.ndims, axes={channel_axis: channels})
filters = (1,) + self.filters + (1,)
scale = self.init_scale ** (1 / (len(self.filters) + 1))