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

Method GetIntegralAsS64

tensorflow/compiler/xla/literal.cc:828–847  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

826}
827
828absl::optional<int64> LiteralBase::GetIntegralAsS64(
829 absl::Span<const int64> multi_index) const {
830 CHECK(LayoutUtil::IsDenseArray(shape()));
831 switch (shape().element_type()) {
832 case PRED:
833 return Get<bool>(multi_index);
834 case U8:
835 return Get<uint8>(multi_index);
836 case S32:
837 return Get<int32>(multi_index);
838 case S64:
839 return Get<int64>(multi_index);
840 case U32:
841 return Get<uint32>(multi_index);
842 case U64:
843 return Get<uint64>(multi_index);
844 default:
845 return absl::nullopt;
846 }
847}
848
849absl::optional<double> LiteralBase::GetAsDouble(
850 absl::Span<const int64> multi_index) const {

Callers 4

CompileMethod · 0.80
HandleRemainderMethod · 0.80
FetchIndexVectorMethod · 0.80
FetchIndexVectorMethod · 0.80

Calls 2

shapeFunction · 0.50
element_typeMethod · 0.45

Tested by

no test coverage detected