MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / linspace_lower

Function linspace_lower

imperative/python/megengine/xla/rules/tensor.py:807–812  ·  view source on GitHub ↗
(ctx, *args: Union[HLOTensor, Sequence[HLOTensor]])

Source from the content-addressed store, hash-verified

805
806@register_lower_rule(mops.Linspace)
807def linspace_lower(ctx, *args: Union[HLOTensor, Sequence[HLOTensor]]):
808 assert len(args) == 3 and len(ctx.vars_in) == 3 and len(ctx.vars_out) == 1
809 assert len(ctx.vars_out[0].shape) == 1, "linspace/arange only support 1D"
810
811 odtype, oshape = ctx.vars_out[0].dtype, ctx.vars_out[0].shape
812 return linspace(args[0], args[1], args[2], odtype, oshape)

Callers

nothing calls this directly

Calls 1

linspaceFunction · 0.70

Tested by

no test coverage detected