Passing hidden states and attention
I was wondering when it makes sense to pass the hidden states and attentions and when not? The hidden states are anyway being calculated, no matter whether I pass them or not, right?As seen here:Theoutputsobject is aSequenceClassifierOutput, as we can see in the documentation of that class below, it means it has an optionalloss, alogitsan optionalhidden_statesand an optionalattentionsattribute. Here we have thelosssince we passed alonglabels, but we don’t havehidden_statesandattentionsbecause we didn’t passoutput_hidden_states=Trueoroutput_attentions=True.Source