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

Function AsIntTensor

tensorflow/compiler/tests/randomized_tests.cc:944–955  ·  view source on GitHub ↗

Helper that converts 'values' to an int32 or int64 Tensor.

Source from the content-addressed store, hash-verified

942
943// Helper that converts 'values' to an int32 or int64 Tensor.
944Tensor AsIntTensor(DataType dtype, const std::vector<int64>& values) {
945 switch (dtype) {
946 case DT_INT32: {
947 std::vector<int32> values32(values.begin(), values.end());
948 return test::AsTensor<int32>(values32);
949 }
950 case DT_INT64:
951 return test::AsTensor<int64>(values);
952 default:
953 LOG(FATAL);
954 }
955}
956
957TEST_F(OpTest, Abs) {
958 Repeatedly([this]() {

Callers 1

TEST_FFunction · 0.85

Calls 2

beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected