RuntimeError: expected scalar type Long but found Bool

Hi,

I am getting the following error:

While I am running the following code:

This is what in train method:

I am stuck with this error and I would appreciate your help. Please note when I change the data type from bool to long for masks I am getting 0s only in pred, 0s only in y_pred, and 0s only in y_true, and this is not should be the case. Please advice.

Thank you.

@ptrblck could you please help me ?

Based on the error message torch_cluster/sampler.py is raising this error, as LongTensors are expected.

Converting a BoolTensor to a LongTensor will only return all zeros, if the BoolTensor was containing only False values, so it might be expected.

1 Like

This helps. Thank you!