def forward(self, roi_features, x, layer_index):
        '''
        Args:
            roi_features: prior feature, shape: (Batch * num_priors, prior_feat_channel, sample_point, 1)
            x: feature map
            layer_index: currently on which layer to refine
        Return: 
            roi: prior features with gathered global information, shape: (Batch, num_priors, fc_hidden_dim)
        '''

        roi = self.roi_fea(roi_features, layer_index)
        # return roi
        # print(roi.shape)
        # return roi
        bs = x.shape[0]
        # print(bs)
        #roi = roi.contiguous().view(bs * self.num_priors, -1)
        roi = roi.reshape([bs * self.num_priors, -1])
        # roi = paddle.randn([192,2304])
        # return roi
        # print(roi)
        # print(self.fc)
        # print(self.fc.weight)
        roi = self.fc(roi)
        roi = F.relu(self.fc_norm(roi))
        # return roi
        #roi = roi.view(bs, self.num_priors, -1)
        roi = roi.reshape([bs, self.num_priors, -1])
        query = roi

        value = self.resize(self.f_value(x))  # (B, C, N) global feature
        query = self.f_query(
            query)  # (B, N, 1) sample context feature from prior roi
        key = self.f_key(x)
        value = value.transpose(perm=[0, 2, 1])
        key = self.resize(key)  # (B, C, N) global feature
        sim_map = paddle.matmul(query, key)
        sim_map = (self.in_channels**-.5) * sim_map
        sim_map = F.softmax(sim_map, axis=-1)

        context = paddle.matmul(sim_map, value)
        context = self.W(context)

        roi = roi + F.dropout(context, p=0.1, training=self.training)

        return roi

        Args:
            roi_features: prior feature, shape: (Batch * num_priors, prior_feat_channel, sample_point, 1)
            x: feature map
            layer_index: currently on which layer to refine
        Return: 
            roi: prior features with gathered global information, shape: (Batch, num_priors, fc_hidden_dim)
        
ppdet/modeling/clrnet_utils.py