Пример #1
0
 def Setup(self, bottom):
     super(NNResizeLayer, self).Setup(bottom)
     input = bottom[0] if isinstance(bottom, list) else bottom
     if isinstance(bottom, list) and len(bottom) > 1:
         dshape = ops.Shape(bottom[1])
         self._param['dsize'] = (dshape[2], dshape[3])
     return ops.NNResize(input, **self._param)
Пример #2
0
 def Setup(self, bottom):
     super(NNResizeLayer, self).Setup(bottom)
     input = bottom[0] if isinstance(bottom, list) else bottom
     if self._param['dsize'] is None:
         if len(bottom) != 2:
             raise ValueError('The second bottom should be provided to determine the shape.')
         self._param['shape_like'] = bottom[1]
     return ops.NNResize(input, **self._param)
Пример #3
0
 def LayerSetup(self, bottom):
     if self.arguments['dsize'] is None:
         if not isinstance(bottom, (tuple, list)) or len(bottom) != 2:
             raise ValueError(
                 'The second bottom should be provided to determine the shape.'
             )
         self.arguments['shape_like'] = bottom[1]
         bottom = bottom[0]
     return _ops.NNResize(bottom, **self.arguments)
Пример #4
0
 def Setup(self, bottom):
     super(NNResizeLayer, self).Setup(bottom)
     input = bottom[0] if isinstance(bottom, list) else bottom
     return ops.NNResize(input, **self._param)