transformer_rankers.utils.utils.acumulate_l1_by_l2

transformer_rankers.utils.utils.acumulate_l1_by_l2(l1: List[float], l2: List[List[float]]) → List[List[float]][source]

Splits a list (l1) using the shape of l2.

Parameters

l – List of floats

Returns: List of list of floats divided by the shape of l2 Example: [0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5] , [[1,1,1,0,0], [1,0,0], [1,1,0,0]]–>

[[0.5,0.5,0.5,0.5,0.5], [0.5,0.5,0.5], [0.5,0.5,0.5,0.5]]