def Setup(self, bottom): super(CropLayer, self).Setup(bottom) self._param['shape_like'] = bottom[1] return ops.Crop(bottom[0], **self._param)
def LayerSetup(self, bottom): if not isinstance(bottom, (tuple, list)) or len(bottom) != 2: raise ValueError('Excepted two bottom blobs.') self.arguments['shape_like'] = bottom[1] self.arguments['starts'] = self.arguments['sizes'] = None return _ops.Crop(bottom[0], **self.arguments)
def Setup(self, bottom): super(CropLayer, self).Setup(bottom) self._param['shape_like'] = bottom[1] self._param['starts'] = self._param['ends'] = None return ops.Crop(bottom[0], **self._param)