Ejemplo n.º 1
0
# ===================================================================

# part_x1_feat = x1.features_at_coordinates(x1.C[:3,:].float())
# part_x1_coord = x1.C[:3,:]

# part_x1 = ME.SparseTensor(
        # coordinates = part_x1_coord,
        # features = part_x1_feat,
        # coordinate_manager = x1.coordinate_manager,
        # )
# out = part_x1 + x1  # out and x1 may not have the same order
# x2_f = x2.F
# x1_f = x1_f**2 + x2_f**2
# y = ME.SparseTensor(features = x1_f, coordinate_map_key=x1.coordinate_map_key, coordinate_manager=x1.coordinate_manager)

pool = ME.MinkowskiGlobalSumPooling()

loss = pool(out).F
loss.backward()

# # if there isnot nearby voxel within kernel size, then no spatial reduction will occur
# # pool = ME.MinkowskiSumPooling(kernel_size=6,stride=2,dimension=3)

# loss = pool(y).F
# loss.backward()

print(feats, feats.grad)