Skip to content

Commit

Permalink
print() is a function in Python 3
Browse files Browse the repository at this point in the history
  • Loading branch information
cclauss authored Jul 14, 2018
1 parent 7504c52 commit 5464771
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions CoordConv-numpy.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import print_function

import numpy as np

class AddCoordsNp():
Expand All @@ -16,25 +18,25 @@ def call(self, input_tensor):
xx_ones = np.ones([1, self.x_dim], dtype=np.int32)
xx_ones = np.expand_dims(xx_ones, -1)

print xx_ones.shape
print(xx_ones.shape)

xx_range = np.expand_dims(np.arange(self.x_dim), 0)
xx_range = np.expand_dims(xx_range, 1)

print xx_range.shape
print(xx_range.shape)

xx_channel = np.matmul(xx_ones, xx_range)
xx_channel = np.expand_dims(xx_channel, -1)

yy_ones = np.ones([1, self.y_dim], dtype=np.int32)
yy_ones = np.expand_dims(yy_ones, 1)

print yy_ones.shape
print(yy_ones.shape)

yy_range = np.expand_dims(np.arange(self.y_dim), 0)
yy_range = np.expand_dims(yy_range, -1)

print yy_range.shape
print(yy_range.shape)

yy_channel = np.matmul(yy_range, yy_ones)
yy_channel = np.expand_dims(yy_channel, -1)
Expand Down

0 comments on commit 5464771

Please sign in to comment.