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

Function TEST

tensorflow/compiler/xla/service/shaped_buffer_test.cc:30–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28namespace {
29
30TEST(ShapedBufferTest, ScopedShapeBufferAsShapedBufferB71629047) {
31 TF_ASSERT_OK_AND_ASSIGN(auto* platform,
32 xla::PlatformUtil::GetDefaultPlatform());
33 TF_ASSERT_OK_AND_ASSIGN(auto executors,
34 xla::PlatformUtil::GetStreamExecutors(platform));
35 xla::se::StreamExecutorMemoryAllocator allocator(platform, executors);
36 const xla::Shape shape = xla::ShapeUtil::MakeShape(xla::F32, {});
37 const int kDeviceOrdinal = 0;
38 auto scoped_buffer = absl::make_unique<xla::ScopedShapedBuffer>(
39 shape, shape, &allocator, kDeviceOrdinal);
40 std::unique_ptr<xla::ShapedBuffer> buffer = std::move(scoped_buffer);
41 buffer = nullptr;
42}
43
44class TestAllocator : public se::DeviceMemoryAllocator {
45 public:

Callers

nothing calls this directly

Calls 15

MakeShapeFunction · 0.85
ShapeIndexViewClass · 0.85
TakeSubTreeMethod · 0.80
IsSameAsMethod · 0.80
SubShapedBufferMethod · 0.80
ConsumeValueOrDieMethod · 0.80
TF_ASSERT_OK_AND_ASSIGNFunction · 0.70
set_bufferMethod · 0.45
AllocateMethod · 0.45
ForEachMutableElementMethod · 0.45
ReleaseMethod · 0.45
ForEachElementMethod · 0.45

Tested by

no test coverage detected