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

Function bitcast

imperative/python/megengine/xla/rules/elemwise.py:113–119  ·  view source on GitHub ↗
(inp, oshape, odtype)

Source from the content-addressed store, hash-verified

111
112
113def bitcast(inp, oshape, odtype):
114 odtype = np.dtype(odtype) if isinstance(odtype, str) else odtype
115 return HLOTensor(
116 hlo.BitcastConvertOp(
117 ir_utils.make_ir_type_according_meta(oshape, odtype), inp.tensor
118 ).result
119 )
120
121
122def typecvt(inp, odtype):

Callers 1

bitcastMethod · 0.85

Calls 2

HLOTensorClass · 0.85
dtypeMethod · 0.45

Tested by

no test coverage detected