IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/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. /max/get-started.md).

Mojo struct

StaticBroadcastTo

struct StaticBroadcastTo

Implemented traits​

AnyType, ImplicitlyDestructible

Methods​

build_view​

static def build_view[out_rank: Int](x: ManagedTensorSlice[Input, static_spec=x.static_spec]) -> IndexList[out_rank]

Returns:

IndexList[out_rank]

get_view_strides_list​

static def get_view_strides_list[out_rank: Int, in_rank: Int, input_shape: IntTuple, input_strides: IntTuple]() -> IndexList[out_rank]

Returns:

IndexList[out_rank]

update_input_view​

static def update_input_view[dtype: DType, in_rank: Int, out_rank: Int, //, output_static_shape: IntTuple](x: ManagedTensorSlice[Input, static_spec=x.static_spec], output_shape: IndexList[out_rank]) -> ManagedTensorSlice[Input, static_spec=x.static_spec.with_int_tuple_layout[out_rank, output_static_shape, StaticBroadcastTo.get_view_strides_list[out_rank, in_rank, StaticTensorSpec[dtype, in_rank, x.static_spec.static_layout, x.static_spec.InFusion, x.static_spec.OutFusion, x.static_spec.ComputeFusion, x.static_spec.ComputeFusionTile].shape_tuple, StaticTensorSpec[dtype, in_rank, x.static_spec.static_layout, x.static_spec.InFusion, x.static_spec.OutFusion, x.static_spec.ComputeFusion, x.static_spec.ComputeFusionTile].strides_tuple]()]()]

Returns:

ManagedTensorSlice[Input, static_spec=x.static_spec.with_int_tuple_layout[out_rank, output_static_shape, StaticBroadcastTo.get_view_strides_list[out_rank, in_rank, StaticTensorSpec[dtype, in_rank, x.static_spec.static_layout, x.static_spec.InFusion, x.static_spec.OutFusion, x.static_spec.ComputeFusion, x.static_spec.ComputeFusionTile].shape_tuple, StaticTensorSpec[dtype, in_rank, x.static_spec.static_layout, x.static_spec.InFusion, x.static_spec.OutFusion, x.static_spec.ComputeFusion, x.static_spec.ComputeFusionTile].strides_tuple]()]()]

execute​

static def execute[target: StringSlice[StaticConstantOrigin], dtype: DType, in_rank: Int, out_rank: Int, _trace_name: StringSlice[StaticConstantOrigin]](z: ManagedTensorSlice[Output, static_spec=z.static_spec], x: ManagedTensorSlice[Input, static_spec=x.static_spec], output_shape: IndexList[out_rank], ctx: DeviceContext)