示例#1
0
文件: cudnn_ops.py 项目: EdsterG/cgt
 def shp_apply(self, inputs):
     info = self.info
     batch_size, channels, height, width = cgt.shape(inputs[0])
     pooled_height =  cgt.ceil_divide(height + 2*info.pad_h - info.kernel_h, info.stride_h)
     pooled_width = cgt.ceil_divide(width + 2*info.pad_w - info.kernel_w, info.stride_w)
     outshape = [batch_size ,  channels, pooled_height, pooled_width]
     return outshape
示例#2
0
文件: cudnn_ops.py 项目: xindaya/cgt
 def shp_apply(self, inputs):
     X, W, _b = inputs
     h = cgt.ceil_divide(
         cgt.size(X, 2) + self.ph * 2 - cgt.size(W, 2) + 1, self.sv)
     w = cgt.ceil_divide(
         cgt.size(X, 3) + self.pw * 2 - cgt.size(W, 3) + 1, self.sh)
     return [cgt.size(X, 0), cgt.size(W, 0), h, w]
示例#3
0
文件: cudnn_ops.py 项目: zxie/cgt
 def shp_apply(self, inputs):
     X, W, _b = inputs
     h = cgt.ceil_divide(
         cgt.size(X, 2) + self.ph * 2 - cgt.size(W, 2) + 1, self.sv)
     w = cgt.ceil_divide(
         cgt.size(X, 3) + self.pw * 2 - cgt.size(W, 3) + 1, self.sh)
     return [cgt.size(X, 0), cgt.size(W, 0), h, w]
示例#4
0
 def shp_apply(self, inputs):
     # pooled_height_ = static_cast<int>(ceil(static_cast<float>(height_ + 2 * pad_h_ - kernel_h_) / stride_h_)) + 1;
     # pooled_width_ = static_cast<int>(ceil(static_cast<float>(width_ + 2 * pad_w_ - kernel_w_) / stride_w_)) + 1;
     info = self.info
     batch_size, channels, height, width = cgt.shape(inputs[0])
     pooled_height =  cgt.ceil_divide(height + 2*info.pad_h - info.kernel_h, info.stride_h)
     pooled_width = cgt.ceil_divide(width + 2*info.pad_w - info.kernel_w, info.stride_w)
     outshape = [batch_size ,  channels, pooled_height, pooled_width]
     return (outshape, outshape)
示例#5
0
文件: cudnn_ops.py 项目: zxie/cgt
 def shp_apply(self, inputs):
     info = self.info
     batch_size, channels, height, width = cgt.shape(inputs[0])
     pooled_height = cgt.ceil_divide(
         height + 2 * info.pad_h - info.kernel_h, info.stride_h)
     pooled_width = cgt.ceil_divide(width + 2 * info.pad_w - info.kernel_w,
                                    info.stride_w)
     outshape = [batch_size, channels, pooled_height, pooled_width]
     return outshape
示例#6
0
 def shp_apply(self, inputs):
     # pooled_height_ = static_cast<int>(ceil(static_cast<float>(height_ + 2 * pad_h_ - kernel_h_) / stride_h_)) + 1;
     # pooled_width_ = static_cast<int>(ceil(static_cast<float>(width_ + 2 * pad_w_ - kernel_w_) / stride_w_)) + 1;
     info = self.info
     batch_size, channels, height, width = cgt.shape(inputs[0])
     pooled_height = cgt.ceil_divide(
         height + 2 * info.pad_h - info.kernel_h, info.stride_h)
     pooled_width = cgt.ceil_divide(width + 2 * info.pad_w - info.kernel_w,
                                    info.stride_w)
     outshape = [batch_size, channels, pooled_height, pooled_width]
     return (outshape, outshape)