Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions SpectralNormalizationKeras.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
class DenseSN(Dense):
def build(self, input_shape):
assert len(input_shape) >= 2
input_dim = input_shape[-1]
input_dim = int(input_shape[-1])
self.kernel = self.add_weight(shape=(input_dim, self.units),
initializer=self.kernel_initializer,
name='kernel',
Expand Down Expand Up @@ -127,7 +127,7 @@ def build(self, input_shape):
if input_shape[channel_axis] is None:
raise ValueError('The channel dimension of the inputs '
'should be defined. Found `None`.')
input_dim = input_shape[channel_axis]
input_dim = int(input_shape[channel_axis])
kernel_shape = self.kernel_size + (input_dim, self.filters)

self.kernel = self.add_weight(shape=kernel_shape,
Expand Down Expand Up @@ -278,7 +278,7 @@ def build(self, input_shape):
if input_shape[channel_axis] is None:
raise ValueError('The channel dimension of the inputs '
'should be defined. Found `None`.')
input_dim = input_shape[channel_axis]
input_dim = int(input_shape[channel_axis])
kernel_shape = self.kernel_size + (input_dim, self.filters)

self.kernel = self.add_weight(shape=kernel_shape,
Expand Down Expand Up @@ -357,7 +357,7 @@ def build(self, input_shape):
if input_shape[channel_axis] is None:
raise ValueError('The channel dimension of the inputs '
'should be defined. Found `None`.')
input_dim = input_shape[channel_axis]
input_dim = int(input_shape[channel_axis])
kernel_shape = self.kernel_size + (input_dim, self.filters)

self.kernel = self.add_weight(shape=kernel_shape,
Expand Down Expand Up @@ -435,7 +435,7 @@ def build(self, input_shape):
if input_shape[channel_axis] is None:
raise ValueError('The channel dimension of the inputs '
'should be defined. Found `None`.')
input_dim = input_shape[channel_axis]
input_dim = int(input_shape[channel_axis])
kernel_shape = self.kernel_size + (input_dim, self.filters)

self.kernel = self.add_weight(shape=kernel_shape,
Expand Down Expand Up @@ -569,7 +569,7 @@ def build(self, input_shape):
if input_shape[channel_axis] is None:
raise ValueError('The channel dimension of the inputs '
'should be defined. Found `None`.')
input_dim = input_shape[channel_axis]
input_dim = int(input_shape[channel_axis])
kernel_shape = self.kernel_size + (self.filters, input_dim)

self.kernel = self.add_weight(shape=kernel_shape,
Expand Down