IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).

Mojo function

get_scale_factor

def get_scale_factor[scales_dtype: DType, //, SF_VECTOR_SIZE: Int](scales_tensor: TileTensor[scales_dtype, Engine=scales_tensor.Engine, address_space=scales_tensor.address_space, linear_idx_type=scales_tensor.linear_idx_type], row_idx: Int, col_idx: Int) -> Scalar[scales_dtype]

Loads a scale factor from a 5D non-batched TileTensor at the given row and column.

TileTensor overload of get_scale_factor that translates the linear (row_idx, col_idx) coordinates into the 5D scale-factor layout and returns the stored scale factor.

Parameters:

  • ​scales_dtype (DType): Element type of the scales tensor.
  • ​SF_VECTOR_SIZE (Int): Number of elements each scale factor covers.

Args:

Returns:

Scalar[scales_dtype]: The scale factor stored at the translated 5D coordinate.

Was this page helpful?