MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / BitcastConvert

Method BitcastConvert

tensorflow/compiler/xla/literal.cc:1316–1329  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1314}
1315
1316StatusOr<Literal> LiteralBase::BitcastConvert(
1317 PrimitiveType primitive_dest_type) const {
1318 if (primitive_util::BitWidth(shape().element_type()) !=
1319 primitive_util::BitWidth(primitive_dest_type)) {
1320 return InvalidArgument(
1321 "Cannot bitcast convert from %s to %s, bit widths are different: %d != "
1322 "%d",
1323 PrimitiveType_Name(shape().element_type()),
1324 PrimitiveType_Name(primitive_dest_type),
1325 primitive_util::BitWidth(shape().element_type()),
1326 primitive_util::BitWidth(primitive_dest_type));
1327 }
1328 return ConvertSwitch(*this, primitive_dest_type, /*bitcast=*/true);
1329}
1330
1331StatusOr<Literal> LiteralBase::ConvertToShape(const Shape& dest_shape) const {
1332 if (!dest_shape.IsTuple()) {

Callers 1

TEST_FFunction · 0.80

Calls 5

BitWidthFunction · 0.85
InvalidArgumentFunction · 0.85
ConvertSwitchFunction · 0.85
shapeFunction · 0.50
element_typeMethod · 0.45

Tested by 1

TEST_FFunction · 0.64