def forward(self, in_dict, return_feats=False):
    if (self.quantization_mode == 'average'):
        quantization_mode = ME.SparseTensorQuantizationMode.UNWEIGHTED_AVERAGE
    elif (self.quantization_mode == 'random'):
        quantization_mode = ME.SparseTensorQuantizationMode.RANDOM_SUBSAMPLE
    in_field = ME.TensorField(features=in_dict['feats'], coordinates=in_dict['coords'], quantization_mode=quantization_mode, minkowski_algorithm=ME.MinkowskiAlgorithm.MEMORY_EFFICIENT, device=in_dict['feats'].device)
    x = in_field.sparse()
    out = self.conv0p1s1(x)
    out = self.bn0(out)
    out_p1 = self.relu(out)
    out = self.conv1p1s2(out_p1)
    out = self.bn1(out)
    out = self.relu(out)
    out_b1p2 = self.block1(out)
    out = self.conv2p2s2(out_b1p2)
    out = self.bn2(out)
    out = self.relu(out)
    out_b2p4 = self.block2(out)
    out = self.conv3p4s2(out_b2p4)
    out = self.bn3(out)
    out = self.relu(out)
    out_b3p8 = self.block3(out)
    out = self.conv4p8s2(out_b3p8)
    out = self.bn4(out)
    out = self.relu(out)
    out = self.block4(out)
    out = self.convtr4p16s2(out)
    out = self.bntr4(out)
    out = self.relu(out)
    out = ME.cat(out, out_b3p8)
    out = self.block5(out)
    out = self.convtr5p8s2(out)
    out = self.bntr5(out)
    out = self.relu(out)
    out = ME.cat(out, out_b2p4)
    out = self.block6(out)
    out = self.convtr6p4s2(out)
    out = self.bntr6(out)
    out = self.relu(out)
    out = ME.cat(out, out_b1p2)
    out = self.block7(out)
    out = self.convtr7p2s2(out)
    out = self.bntr7(out)
    out = self.relu(out)
    out = ME.cat(out, out_p1)
    out_feats = self.block8(out)
    out = self.final(out_feats)
    feats = out.slice(in_field).F
    if return_feats:
        return (feats, out_feats.slice(in_field).F)
    return feats
def forward(self, in_dict, return_feats=False):
    if (self.quantization_mode == 'average'):
        quantization_mode = ME.SparseTensorQuantizationMode.UNWEIGHTED_AVERAGE
    elif (self.quantization_mode == 'random'):
        quantization_mode = ME.SparseTensorQuantizationMode.RANDOM_SUBSAMPLE
    in_field = ME.TensorField(features=in_dict['feats'], coordinates=in_dict['coords'], quantization_mode=quantization_mode, minkowski_algorithm=ME.MinkowskiAlgorithm.MEMORY_EFFICIENT, device=in_dict['feats'].device)
    x = in_field.sparse()
    out = self.conv0p1s1(x)
    out = self.bn0(out)
    out_p1 = self.relu(out)
    out = self.conv1p1s2(out_p1)
    out = self.bn1(out)
    out = self.relu(out)
    out_b1p2 = self.block1(out)
    out = self.conv2p2s2(out_b1p2)
    out = self.bn2(out)
    out = self.relu(out)
    out_b2p4 = self.block2(out)
    out = self.conv3p4s2(out_b2p4)
    out = self.bn3(out)
    out = self.relu(out)
    out_b3p8 = self.block3(out)
    out = self.conv4p8s2(out_b3p8)
    out = self.bn4(out)
    out = self.relu(out)
    out = self.block4(out)
    out = self.convtr4p16s2(out)
    out = self.bntr4(out)
    out = self.relu(out)
    out = ME.cat(out, out_b3p8)
    out = self.block5(out)
    out = self.convtr5p8s2(out)
    out = self.bntr5(out)
    out = self.relu(out)
    out = ME.cat(out, out_b2p4)
    out = self.block6(out)
    out = self.convtr6p4s2(out)
    out = self.bntr6(out)
    out = self.relu(out)
    out = ME.cat(out, out_b1p2)
    out = self.block7(out)
    out = self.convtr7p2s2(out)
    out = self.bntr7(out)
    out = self.relu(out)
    out = ME.cat(out, out_p1)
    out_feats = self.block8(out)
    out = self.final(out_feats)
    feats = out.slice(in_field).F
    if return_feats:
        return (feats, out_feats.slice(in_field).F)
    return feats