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

Method GetElementComponentFromBatch

tensorflow/core/kernels/priority_queue.cc:117–128  ·  view source on GitHub ↗

static */

Source from the content-addressed store, hash-verified

115
116/* static */
117Status PriorityQueue::GetElementComponentFromBatch(
118 const PriorityQueue::Tuple& tuple, int index, int component,
119 OpKernelContext* ctx, PersistentTensor* out_tensor) {
120 TensorShape element_shape(tuple[component].shape());
121 element_shape.RemoveDim(0);
122 Tensor* element_access = nullptr;
123 TF_RETURN_IF_ERROR(ctx->allocate_persistent(
124 tuple[component].dtype(), element_shape, out_tensor, &element_access));
125 TF_RETURN_IF_ERROR(
126 batch_util::CopySliceToElement(tuple[component], element_access, index));
127 return Status::OK();
128}
129
130void PriorityQueue::TryEnqueueMany(const Tuple& tuple, OpKernelContext* ctx,
131 DoneCallback callback) {

Callers

nothing calls this directly

Calls 5

CopySliceToElementFunction · 0.85
shapeMethod · 0.45
RemoveDimMethod · 0.45
allocate_persistentMethod · 0.45
dtypeMethod · 0.45

Tested by

no test coverage detected