(self, in_obj)
return self
Must receive a list of shapes for configurations
        Need both the layer container and roi dataset to configure shapes
        'in_obj' will include be [image_shape, roi_shape] (e.g [(3, 600, 1000), 5])

        Arguments:
            in_obj:

        Returns:
Must receive a list of shapes for configurations
        Need both the layer container and roi dataset to configure shapes
        'in_obj' will include be [image_shape, roi_shape] (e.g [(3, 600, 1000), 5])
Must receive a list of shapes for configurations Need both the layer container and roi dataset to configure shapes in_obj will include be [ image_shape roi_shape ] ( e . g [ ( 3 600 1000 ) 5 ] )
def configure(self, in_obj):
        """
        Must receive a list of shapes for configurations
        Need both the layer container and roi dataset to configure shapes
        'in_obj' will include be [image_shape, roi_shape] (e.g [(3, 600, 1000), 5])

        Arguments:
            in_obj:

        Returns:

        """
        # configure to get the shape of feature map
        assert len(in_obj) == 2, "Input to ROIpooling must be a 2-tuple"
        self.prev_layer = in_obj
        img_fm, rois = in_obj

        # configure number of rois
        assert rois.out_shape[0] == 5, "Input ROIs must be a 5-tuple"
        self.rois_per_img = rois.out_shape[1]

        # configure input image feature map shapes
        self.in_shape = img_fm.out_shape
        (self.fm_channel, self.fm_height, self.fm_width) = self.in_shape
        self.error_in_reshape = (self.fm_channel, -1)
        self.fm_reshape_shape = (
            self.fm_channel, self.fm_height * self.fm_width, self.be.bsz)

        # make the out_shape as a tuple, as if the roi_per_image a
        # time_step dimension
        self.out_shape = (self.fm_channel * self.roi_H * self.roi_W, self.rois_per_img)
        return self
def configure ( self , in_obj ) : # configure to get the shape of feature map assert len ( in_obj ) == 2 , "Input to ROIpooling must be a 2-tuple" self . prev_layer = in_obj img_fm , rois = in_obj # configure number of rois assert rois . out_shape [ 0 ] == 5 , "Input ROIs must be a 5-tuple" self . rois_per_img = rois . out_shape [ 1 ] # configure input image feature map shapes self . in_shape = img_fm . out_shape ( self . fm_channel , self . fm_height , self . fm_width ) = self . in_shape self . error_in_reshape = ( self . fm_channel , - 1 ) self . fm_reshape_shape = ( self . fm_channel , self . fm_height * self . fm_width , self . be . bsz ) # make the out_shape as a tuple, as if the roi_per_image a # time_step dimension self . out_shape = ( self . fm_channel * self . roi_H * self . roi_W , self . rois_per_img ) return self