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 struct

Struct_moe_single_group_router_image_bias

struct Struct_moe_single_group_router_image_bias

Registers the mo.moe.single.group.router.image.bias graph op.

The single-group router selecting with image_bias for tokens whose id is image_token_id and with expert_bias for the rest.

Implemented traitsโ€‹

AnyType, Deinitable, Movable

Methodsโ€‹

executeโ€‹

static def execute[scores_type: DType, bias_type: DType, ids_type: DType, //, n_routed_experts: Int, n_experts_per_tok: Int, norm_weights: Bool, image_token_id: Int, target: StaticString](expert_indices: ManagedTensorSlice[IOSpec[_, _].Output, static_spec=expert_indices.static_spec], expert_weights: ManagedTensorSlice[IOSpec[_, _].Output, static_spec=expert_weights.static_spec], expert_scores: ManagedTensorSlice[IOSpec[_, _].FusedInput, static_spec=expert_scores.static_spec], expert_bias: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=expert_bias.static_spec], image_bias: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=image_bias.static_spec], token_ids: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=token_ids.static_spec], routed_scaling_factor: Float32, context: DeviceContext)

Was this page helpful?