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

Class AllocationAttributes

tensorflow/core/framework/allocator.h:37–63  ·  view source on GitHub ↗

Attributes for a single allocation call. Different calls to the same allocator could potentially have different allocation attributes.

Source from the content-addressed store, hash-verified

35// Attributes for a single allocation call. Different calls to the same
36// allocator could potentially have different allocation attributes.
37struct AllocationAttributes {
38 AllocationAttributes() = default;
39
40 AllocationAttributes(bool no_retry_on_failure, bool allocation_will_be_logged,
41 std::function<uint64()>* freed_by_func)
42 : no_retry_on_failure(no_retry_on_failure),
43 allocation_will_be_logged(allocation_will_be_logged),
44 freed_by_func(freed_by_func) {}
45
46 // If the first attempt to allocate the memory fails, the allocation
47 // should return immediately without retrying.
48 // An example use case is optional scratch spaces where a failure
49 // has only performance impact.
50 bool no_retry_on_failure = false;
51 // If a Tensor is allocated without the following set to true, then
52 // it is logged as an unknown allocation. During execution Tensors
53 // should be allocated through the OpKernelContext which records
54 // which Op is performing the allocation, and sets this flag to
55 // true.
56 bool allocation_will_be_logged = false;
57 // EXPERIMENTAL: If provided, then evaluates to a timing count such that only
58 // a memory chunk whose freed_at_count is at this value or earlier may be
59 // returned.
60 std::function<uint64()>* freed_by_func = nullptr; // Not owned.
61
62 TF_DISALLOW_COPY_AND_ASSIGN(AllocationAttributes);
63};
64
65// Runtime statistics collected by an allocator. Exactly the same as
66// stream_executor::AllocatorStats, but independently defined to preserve the

Callers 15

RecvFromRemoteAsyncMethod · 0.85
BufferMethod · 0.85
allocate_tempMethod · 0.85
allocate_tensorMethod · 0.85
allocate_tensorMethod · 0.85
AllocateRawMethod · 0.85
BatchLookupOrCreateMethod · 0.85
GetSnapshotMethod · 0.85
ImportMethod · 0.85
ResizeMethod · 0.85
allocateMethod · 0.85

Calls

no outgoing calls

Tested by 2

ReInitMethod · 0.68
TESTFunction · 0.68