osc.viz.rollout.cross_attn_rollout

cross_attn_rollout(attns)[source]

Cross attention rollout: how much an object token attends to context tokens.

Parameters

attns – dict or list where entries alternate self attention with shape [B heads S S] and cross attention with shape [B heads S K].

Returns

Rollout, shape [B S K]