Skip to main content

expand

Function expand 

Source
pub fn expand<S: CubePrimitive>(
    scope: &Scope,
    global_scale: <f32 as CubeType>::ExpandType,
    scale: <S as CubeType>::ExpandType,
) -> <f32 as CubeType>::ExpandType
Expand description

The effective scale of values whose per-tensor scale multiplies on top of their block scale.

The two multiply in f32: a block scale is normalized against the per-tensor one, so on its own it overflows a narrow compute type by orders of magnitude before the global scale can bring the product back into range.