DiffDock icon indicating copy to clipboard operation
DiffDock copied to clipboard

When the edge_index in build_cross_conv_graph function get a empty tensor?

Open alpha-beta-user opened this issue 2 years ago • 0 comments

def build_cross_conv_graph(self, data, cross_distance_cutoff): # builds the cross edges between ligand and receptor if torch.is_tensor(cross_distance_cutoff): # different cutoff for every graph (depends on the diffusion time) edge_index = radius(data['receptor'].pos / cross_distance_cutoff[data['receptor'].batch], data['ligand'].pos / cross_distance_cutoff[data['ligand'].batch], 1, data['receptor'].batch, data['ligand'].batch, max_num_neighbors=10000) else: edge_index = radius(data['receptor'].pos, data['ligand'].pos, cross_distance_cutoff, data['receptor'].batch, data['ligand'].batch, max_num_neighbors=10000)

    src, dst = edge_index
    edge_vec = data['receptor'].pos[dst.long()] - data['ligand'].pos[src.long()]

    edge_length_emb = self.cross_distance_expansion(edge_vec.norm(dim=-1))
    edge_sigma_emb = data['ligand'].node_sigma_emb[src.long()]
    edge_attr = torch.cat([edge_sigma_emb, edge_length_emb], 1)
    edge_sh = o3.spherical_harmonics(self.sh_irreps, edge_vec, normalize=True, normalization='component')

    return edge_index, edge_attr, edge_sh

I force the edge_index to a 2x0 tensor, then the paragram stops can't run. so I want to know if there exists such a condition, if so, what can be done to resolve it.

Thank you for your reply!

alpha-beta-user avatar Apr 26 '23 08:04 alpha-beta-user