I am coding a custom loss function wherein there is an index variable which can change in length depending on a condition (e.g. where y_pred > 0.).
y_pred > 0.