Skip to content

Commit 10cbd03

Browse files
Johannes Ballécopybara-github
authored andcommitted
Some minor fixes.
- Adds logic that prevents reinstalling TF within Colab. - Cosmetic changes. PiperOrigin-RevId: 449312782 Change-Id: I90084da39bc6413edcfc7a8584411b0432e085c7
1 parent 3b70187 commit 10cbd03

File tree

4 files changed

+14
-5
lines changed

4 files changed

+14
-5
lines changed

models/hific/colab.ipynb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,15 @@
3131
},
3232
"outputs": [],
3333
"source": [
34-
"!pip install tensorflow-compression\n",
34+
"# Installs the latest version of TFC compatible with the installed TF version.\n",
35+
"!pip install tensorflow-compression~=$(pip show tensorflow | perl -p -0777 -e 's/.*Version: (\\d\\.\\d).*/\\1.0/sg')\n",
36+
"\n",
37+
"# Downloads the 'models' directory from Github.\n",
3538
"![[ -e /tfc ]] || git clone https://github.com/tensorflow/compression /tfc\n",
3639
"%cd /tfc/models\n",
37-
"import tfci # Check if tfci.py is available."
40+
"\n",
41+
"# Checks if tfci.py is available.\n",
42+
"import tfci\n"
3843
]
3944
},
4045
{

models/toy_sources/toy_sources.ipynb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@
3737
"# Run this cell to install the necessary dependencies when running the notebook\n",
3838
"# directly in a Colaboratory hosted runtime from Github.\n",
3939
"\n",
40-
"!pip install tensorflow-compression\n",
40+
"# Installs the latest version of TFC compatible with the installed TF version.\n",
41+
"!pip install tensorflow-compression~=$(pip show tensorflow | perl -p -0777 -e 's/.*Version: (\\d\\.\\d).*/\\1.0/sg')\n",
42+
"\n",
43+
"# Downloads the 'models' directory from Github.\n",
4144
"![[ -e /tfc ]] || git clone https://github.com/tensorflow/compression /tfc\n",
4245
"%cd /tfc/models\n"
4346
],

tensorflow_compression/python/datasets/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414
# ==============================================================================
15-
"""Data loaders based on `tf.data.Dataset`."""
15+
"""Data loaders, based on `tf.data.Dataset`."""
1616

1717
from tensorflow_compression.python.datasets.y4m_dataset import *

tensorflow_compression/python/ops/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414
# ==============================================================================
15-
"""Ops."""
15+
"""Operations."""
16+
1617
from tensorflow_compression.python.ops.gen_ops import *
1718
from tensorflow_compression.python.ops.math_ops import *
1819
from tensorflow_compression.python.ops.padding_ops import *

0 commit comments

Comments
 (0)