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

Method MakeTuple

tensorflow/compiler/xla/python/shared_device_buffer.cc:109–127  ·  view source on GitHub ↗

static */

Source from the content-addressed store, hash-verified

107}
108
109/* static */ StatusOr<std::shared_ptr<SharedDeviceBuffer>>
110SharedDeviceBuffer::MakeTuple(
111 std::vector<std::shared_ptr<SharedDeviceBuffer>> children,
112 const Shape& on_host_shape, TransferManager* transfer_manager,
113 se::DeviceMemoryAllocator* allocator, int device_ordinal,
114 std::shared_ptr<BufferDefinitionEvent> definition_event) {
115 CHECK(on_host_shape.IsTuple() &&
116 on_host_shape.tuple_shapes_size() == children.size());
117 TF_ASSIGN_OR_RETURN(
118 se::OwningDeviceMemory device_memory,
119 allocator->Allocate(
120 device_ordinal,
121 transfer_manager->GetByteSizeRequirement(on_host_shape)));
122 return std::make_shared<SharedDeviceBuffer>(
123 allocator, device_ordinal,
124 std::initializer_list<se::DeviceMemoryBase>{device_memory.Release()},
125 std::move(children), std::move(definition_event),
126 /*on_delete_callback=*/nullptr);
127}
128
129/* static */ StatusOr<std::shared_ptr<SharedDeviceBuffer>>
130SharedDeviceBuffer::MakeArray(

Callers

nothing calls this directly

Calls 4

tuple_shapes_sizeMethod · 0.80
IsTupleMethod · 0.45
sizeMethod · 0.45
ReleaseMethod · 0.45

Tested by

no test coverage detected