Helper that converts 'values' to an int32 or int64 Tensor.
| 942 | |
| 943 | // Helper that converts 'values' to an int32 or int64 Tensor. |
| 944 | Tensor 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 | |
| 957 | TEST_F(OpTest, Abs) { |
| 958 | Repeatedly([this]() { |