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

Method InsertValueCopy

tensorflow/core/framework/variant.h:562–573  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

560 // this method.
561 template <typename T, typename VT>
562 void InsertValueCopy(const T& value) {
563 if (is_inline_) {
564 Value<VT>* inline_value_data =
565 reinterpret_cast<Value<VT>*>(value_.inline_value.value_data);
566 new (inline_value_data) Value<VT>(kInPlace, value);
567 value_.inline_value.has_value = true;
568 } else {
569 auto* moved = static_cast<Value<VT>*>(port::Malloc(sizeof(Value<VT>)));
570 new (moved) Value<VT>(kInPlace, value);
571 value_.heap_value = HeapValue(moved);
572 }
573 }
574};
575
576// Make sure that a Variant object can reside in a 64-byte aligned Tensor

Callers

nothing calls this directly

Calls 1

MallocFunction · 0.50

Tested by

no test coverage detected