Update bert_layers.py
Browse files- bert_layers.py +12 -8
bert_layers.py
CHANGED
@@ -950,14 +950,18 @@ class BertForSequenceClassification(BertPreTrainedModel):
|
|
950 |
return ((loss,) + output) if loss is not None else output
|
951 |
|
952 |
# print(outputs.attentions)
|
953 |
-
|
954 |
-
|
955 |
-
|
956 |
-
|
957 |
-
|
958 |
-
|
959 |
-
|
960 |
-
|
|
|
|
|
|
|
|
|
961 |
|
962 |
return SequenceClassifierOutput(
|
963 |
loss=loss,
|
|
|
950 |
return ((loss,) + output) if loss is not None else output
|
951 |
|
952 |
# print(outputs.attentions)
|
953 |
+
try:
|
954 |
+
print(f'not stacked final attention SHAPE: {outputs[2][0].shape}')
|
955 |
+
except:
|
956 |
+
print(f'not stacked final attention LEN: {len(outputs[2])}')
|
957 |
+
|
958 |
+
try:
|
959 |
+
print(f'STACKED final attention SHAPE: {(outputs.attentions).shape}')
|
960 |
+
except:
|
961 |
+
try:
|
962 |
+
print(f'STACKED final attention LEN: {(outputs.attentions)[0].shape}')
|
963 |
+
except:
|
964 |
+
print(f'STACKED final attention LEN 2: {len(outputs.attentions)}")
|
965 |
|
966 |
return SequenceClassifierOutput(
|
967 |
loss=loss,
|