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

Function TEST

tensorflow/compiler/xla/python/shared_device_buffer_test.cc:27–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25namespace {
26
27TEST(SharedDeviceBufferTest, MakeArray) {
28 LocalClient* client = ClientLibrary::LocalClientOrDie();
29
30 Shape shape = ShapeUtil::MakeShape(F32, {3, 101, 4});
31 TF_ASSERT_OK_AND_ASSIGN(
32 auto buffer, SharedDeviceBuffer::MakeArray(
33 shape, client->backend().transfer_manager(),
34 client->backend().memory_allocator(), 0, nullptr));
35 EXPECT_EQ(buffer->children().size(), 0);
36 EXPECT_EQ(buffer->device_ordinal(), 0);
37 EXPECT_EQ(buffer->allocator(), client->backend().memory_allocator());
38 ASSERT_EQ(buffer->device_memory().size(), 1);
39 EXPECT_FALSE(buffer->device_memory()[0].is_null());
40}
41
42TEST(SharedDeviceBufferTest, MakeTuple) {
43 LocalClient* client = ClientLibrary::LocalClientOrDie();

Callers

nothing calls this directly

Calls 15

MakeShapeFunction · 0.85
backendMethod · 0.80
IsSameAsMethod · 0.80
OneFunction · 0.50
sizeMethod · 0.45
childrenMethod · 0.45
device_ordinalMethod · 0.45
allocatorMethod · 0.45
memory_allocatorMethod · 0.45
device_memoryMethod · 0.45
is_nullMethod · 0.45

Tested by

no test coverage detected