after i trained the model and try to use shap explainer this line rasie an error
‘’‘shap_values = e.shap_values(sequences_to_explain) ‘’’
‘’‘raise RuntimeError(“grad can be implicitly created only for scalar outputs”)
RuntimeError: grad can be implicitly created only for scalar outputs’’’
I already looked at other posts that said it related to loss.backward but the answers did not work for me.
Any suggestions