array_impl_test_lib.cc
imports xla/tsl/platform/statusor.himports xla/tsl/platform/test.h
SHA-25620e9a3b81ba1107dce3054e8c2830c00c582b142ba95ff8a460482a4b8ee8fe8
MaleculeMd₂(In₂Pa)
Evidence
1/* Copyright 2022 The OpenXLA Authors.
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 …
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 <cstdint>
17#include <memory>
18#include <optional>
19#include <utility>
20#include <vector>
21
22#include <gmock/gmock.h>
23#include "absl/algorithm/container.h"
24#include "absl/container/flat_hash_set.h"
25#include "absl/container/inlined_vector.h"
26#include "absl/status/status.h"
27#include "absl/strings/cord.h"
28#include "absl/strings/str_cat.h"
29#include "absl/synchronization/notification.h"
30#include "absl/time/clock.h"
31#include "absl/time/time.h"
32#include "absl/types/span.h"
33#include "xla/layout_util.h"
34#include "xla/pjrt/pjrt_layout.h"
35#include "xla/python/ifrt/array.h"
36#include "xla/python/ifrt/array_spec.h"
37#include "xla/python/ifrt/client.h"
38#include "xla/python/ifrt/device.h"
39#include "xla/python/ifrt/device_list.h"
40#include "xla/python/ifrt/dtype.h"
41#include "xla/python/ifrt/layout.h"
42#include "xla/python/ifrt/memory.h"
43#include "xla/python/ifrt/shape.h"
44#include "xla/python/ifrt/sharding.h"
45#include "xla/python/ifrt/test_util.h"
46#include "xla/python/ifrt/user_context.h"
47#include "xla/python/ifrt/value.h"
48#include "xla/tsl/concurrency/future.h"
49#include "xla/tsl/concurrency/ref_count.h"
50#include "xla/tsl/lib/core/status_test_util.h"
51#include "xla/tsl/platform/statusor.h"
52#include "xla/tsl/platform/test.h"
53
54namespace xla {
⋯4 lines
105:2… /*on_done_with_host_buffer=*/nullptr));
106
107 EXPECT_EQ(array->dtype(), dtype);
108 EXPECT_EQ(array->shape(), shape);
109 EXPECT_EQ(array->shared_ptr_sharding().get(), sharding.get());
110 …
500:19… SingleDeviceShardSemantics::kAddressableShards));
501 ASSERT_EQ(single_device_arrays.size(), devices.size());
502 for (int i = 0; i < single_device_arrays.size(); ++i) {
503 EXPECT_THAT(single_ …
1287:8… e input array should have been donated and marked as deleted.
1288 EXPECT_TRUE(array->IsDeleted());
1289
1290 // Some IFRT implementations that do not support bitcasting may not
1291 // immediately return `Unimplemen …