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

Function fill_lower

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

Source from the content-addressed store, hash-verified

714
715@register_lower_rule(mops.Fill)
716def fill_lower(ctx, *args: Union[HLOTensor, Sequence[HLOTensor]]):
717 assert len(args) == 1 and len(ctx.vars_in) == 1 and len(ctx.vars_out) == 1
718 assert ctx.vars_out[0].dtype == ctx.op.dtype
719 _check_shape(ctx.vars_out[0].shape, ctx.vars_in[0].bound_data)
720 value = ctx.op.value
721 dtype = ctx.vars_out[0].dtype
722 shape = ctx.vars_out[0].shape
723 return fill(value, shape, dtype)
724
725
726@register_lower_rule(mops.FillLike)

Callers

nothing calls this directly

Calls 2

_check_shapeFunction · 0.85
fillFunction · 0.85

Tested by

no test coverage detected