Add print statements
Browse files- modeling_cogvlm.py +6 -3
modeling_cogvlm.py
CHANGED
@@ -285,13 +285,16 @@ class VisionExpertAttention(nn.Module):
|
|
285 |
|
286 |
if print_values:
|
287 |
print("Shape of query_states:", query_states.shape)
|
288 |
-
print("
|
|
|
289 |
|
290 |
print("Shape of key_states:", key_states.shape)
|
291 |
-
print("
|
|
|
292 |
|
293 |
print("Shape of value_states:", value_states.shape)
|
294 |
-
print("First values of value_states:", value_states[0,0
|
|
|
295 |
|
296 |
context_layer = attention_fn(
|
297 |
query_layer=query_states, key_layer=key_states, value_layer=value_states, attention_mask=attention_mask,
|
|
|
285 |
|
286 |
if print_values:
|
287 |
print("Shape of query_states:", query_states.shape)
|
288 |
+
print("Last values of query_states:", query_states[0,0,-3:,-3:])
|
289 |
+
print("Mean of query_states:", query_states.mean())
|
290 |
|
291 |
print("Shape of key_states:", key_states.shape)
|
292 |
+
print("Last values of key_states:", key_states[0,0,-3:,-3:])
|
293 |
+
print("Mean of key_states:", key_states.mean())
|
294 |
|
295 |
print("Shape of value_states:", value_states.shape)
|
296 |
+
print("First values of value_states:", value_states[0,0,-3:,-3:])
|
297 |
+
print("Mean of value_states:", value_states.mean())
|
298 |
|
299 |
context_layer = attention_fn(
|
300 |
query_layer=query_states, key_layer=key_states, value_layer=value_states, attention_mask=attention_mask,
|