Benign repos Download

xla_launch_util_test.cc

Google Test frameworkimports tensorflow/core/platform/refcount.h
SHA-256d5a6bebbd0b7f29f4c9bcebb9d6042ff9eded8532e9f987cfed2b9917be79ef7

Evidence

apache web server name lines 1–10
1/* Copyright 2023 The TensorFlow Authors. All Rights Reserved.
2
3Licensed under the Apache License, Version 2.0 (the "License");
4you may not use this file except in compliance with the License.
5You may obtain a copy of the License at
6
7 http://www.apache.org/licenses/LICENSE-2.0
8
9Unless required by applicable law or agreed to in writing, software
10distributed under the License is …
imports tensorflow/core/platform/refcount.h lines 11–58
11:42… IND, either express or implied.
12See the License for the specific language governing permissions and
13limitations under the License.
14==============================================================================*/
15
16#include "tensorflow/compiler/jit/xla_launch_util.h"
17
18#include <cstdint>
19#include <memory>
20#include <utility>
21#include <vector>
22
23#include <gtest/gtest.h>
24#include "absl/container/flat_hash_map.h"
25#include "absl/container/flat_hash_set.h"
26#include "absl/log/check.h"
27#include "absl/status/statusor.h"
28#include "absl/types/span.h"
29#include "tensorflow/compiler/jit/device_compilation_profiler.h"
30#include "tensorflow/compiler/jit/device_compiler.h"
31#include "tensorflow/compiler/jit/device_executable_persistor.h"
32#include "tensorflow/compiler/jit/flags.h"
33#include "tensorflow/compiler/jit/pjrt_device_compiler_client.h"
34#include "tensorflow/compiler/jit/variable_info.h"
35#include "tensorflow/compiler/jit/variable_info_util.h"
36#include "tensorflow/compiler/tf2xla/xla_compiler.h"
37#include "tensorflow/compiler/tf2xla/xla_op_registry.h"
38#include "xla/literal.h"
39#include "xla/literal_util.h"
40#include "xla/pjrt/pjrt_client.h"
41#include "xla/pjrt/pjrt_common.h"
42#include "xla/pjrt/pjrt_executable.h"
43#include "xla/pjrt/plugin/xla_cpu/cpu_client_options.h"
44#include "xla/pjrt/plugin/xla_cpu/xla_cpu_pjrt_client.h"
45#include "xla/tests/literal_test_util.h"
46#include "xla/tsl/framework/device_id_utils.h"
47#include "xla/tsl/lib/core/status_test_util.h"
48#include "xla/tsl/platform/statusor.h"
49#include "tensorflow/core/framework/allocator.h"
50#include "tensorflow/core/framework/device.h"
51#include "tensorflow/core/framework/device_base.h"
52#include "tensorflow/core/framework/device_factory.h"
53#include "tensorflow/core/framework/fake_input.h"
54#include "tensorflow/core/framework/node_def_builder.h"
55#include "tensorflow/core/framework/resource_handle.h"
56#include "tensorflow/core/framework/resource_mgr.h"
57#include "tensorflow/core/framework/tensor_shape.h"
58#include "tensorflow/core/framework/tensor_testutil.h"
TEST_F macro lines 276–282
276:21… * device_compiler_;
277 DeviceCompilationProfiler* profiler_;
278};
279
280TEST_F(PjRtExecutionUtilTest, PreparePjRtExecutableArguments) {
281 std::vector<const Tensor*> inputs;
282 inputs.push_back(CreateDeviceTe …
C/C++ unit-test EXPECT_EQ marker lines 296–305
296:49… gs,
297 /*owned_args=*/{}, &non_donatable_input_indices));
298
299 EXPECT_EQ(exec_args.size(), 2);
300
301 std::shared_ptr<xla::Literal> literal1 = *exec_args[0]->ToLiteral().Await();
302 EXPECT_TRUE(xla::LiteralTestUtil::Equal(
303 *literal1, xla::LiteralUtil::CreateR2<int32_t>({{1, 2, 3}})));
304
305 std::shared_ptr<xla::Liter …
C/C++ unit-test ASSERT_EQ marker lines 710–717
710:43… s) {
711 TF_ASSERT_OK(output->GetReadyFuture().Await());
712 }
713
714 ASSERT_EQ(execute_outputs.size(), 1);
715 std::shared_ptr<xla::Literal> literal =
716 *execute_outputs[0]->ToLiteral().Await();
717 EXPECT_ …

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.