from typing import Sequence
from typing import Union
from typing import List
from typing import Tuple


def scale_with_abs_strides(seq: Sequence[float],
                           strides: Sequence[Union[Sequence[Union[int, float]], Union[int, float]]],
                           dim_idx: int,
                           ) -> List[Tuple[float]]:
    """
    Scale values with absolute stride between feature maps
    
    Args:
        seq: sequence to scale
        strides: strides to scale with.
        dim_idx: dimension index for stride
    """
    scaled = []
    for stride in strides:
        if not isinstance(stride, (float, int)):
            _stride = stride[dim_idx]
        else:
            _stride = stride
        _scaled = [i * _stride for i in seq]
        scaled.append(tuple(_scaled))
    return scaled