Skip to content

Commit 19a80e0

Browse files
committed
util adding torch import
1 parent 0afb904 commit 19a80e0

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

mitdeeplearning/util.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import matplotlib.pyplot as plt
2-
import tensorflow as tf
32
import time
43
import numpy as np
54

@@ -8,6 +7,7 @@
87

98

109
def display_model(model):
10+
import tensorflow as tf
1111
tf.keras.utils.plot_model(model, to_file="tmp.png", show_shapes=True)
1212
return ipythondisplay.Image("tmp.png")
1313

@@ -29,6 +29,7 @@ def plot_sample(x, y, vae, backend='tf'):
2929
recon = np.clip(recon, 0, 1)
3030

3131
elif backend == 'pt':
32+
import torch
3233
y = y.detach().cpu().numpy()
3334
face_indices = np.where(y == 1)[0]
3435
idx = face_indices[0] if len(face_indices) > 0 else 0

setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ def get_dist(pkgname):
2222
setup(
2323
name = 'mitdeeplearning', # How you named your package folder (MyLib)
2424
packages = ['mitdeeplearning'], # Chose the same as "name"
25-
version = '0.7.2', # Start with a small number and increase it with every change you make
25+
version = '0.7.3', # Start with a small number and increase it with every change you make
2626
license='MIT', # Chose a license from here: https://help.github.com/articles/licensing-a-repository
2727
description = 'Official software labs for MIT Introduction to Deep Learning (http://introtodeeplearning.com)', # Give a short description about your library
2828
author = 'Alexander Amini', # Type in your name
2929
author_email = 'introtodeeplearning-staff@mit.edu', # Type in your E-Mail
3030
url = 'http://introtodeeplearning.com', # Provide either the link to your github or to your website
31-
download_url = 'https://github.com/aamini/introtodeeplearning/archive/v0.7.2.tar.gz', # I explain this later on
31+
download_url = 'https://github.com/aamini/introtodeeplearning/archive/v0.7.3.tar.gz', # I explain this later on
3232
keywords = ['deep learning', 'neural networks', 'tensorflow', 'introduction'], # Keywords that define your package best
3333
install_requires=install_deps,
3434
classifiers=[

0 commit comments

Comments
 (0)