Skip to content

Commit

Permalink
Remove cupy dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
hvy committed May 26, 2017
1 parent 4b3daf4 commit 0f6bd1d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/models/vgg.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import cupy
import chainer
from chainer import cuda
from chainer import Variable
import chainer.links as L
import chainer.functions as F
from chainer import Variable


class VGG(chainer.Chain):
Expand Down Expand Up @@ -127,8 +127,8 @@ def check_add_deconv_layers(self, nobias=True):
for conv in conv_block:
out_channels, in_channels, kh, kw = conv.W.data.shape

if isinstance(conv.W.data, cupy.ndarray):
initialW = cupy.asnumpy(conv.W.data)
if isinstance(conv.W.data, cuda.ndarray):
initialW = cuda.cupy.asnumpy(conv.W.data)
else:
initialW = conv.W.data

Expand All @@ -138,7 +138,7 @@ def check_add_deconv_layers(self, nobias=True):
initialW=initialW,
nobias=nobias)

if isinstance(conv.W.data, cupy.ndarray):
if isinstance(conv.W.data, cuda.ndarray):
deconv.to_gpu()

self.add_link('de{}'.format(conv.name), deconv)
Expand Down

0 comments on commit 0f6bd1d

Please sign in to comment.