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

Method InsertValueMove

tensorflow/core/framework/variant.h:546–557  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

544 // this method.
545 template <typename T, typename VT>
546 void InsertValueMove(T&& value) {
547 if (is_inline_) {
548 Value<VT>* inline_value_data =
549 reinterpret_cast<Value<VT>*>(value_.inline_value.value_data);
550 new (inline_value_data) Value<VT>(kInPlace, std::forward<T>(value));
551 value_.inline_value.has_value = true;
552 } else {
553 auto* moved = static_cast<Value<VT>*>(port::Malloc(sizeof(Value<VT>)));
554 new (moved) Value<VT>(kInPlace, std::forward<T>(value));
555 value_.heap_value = HeapValue(moved);
556 }
557 }
558
559 // PRECONDITION: Called on construction or clear() has been called before
560 // this method.

Callers

nothing calls this directly

Calls 1

MallocFunction · 0.50

Tested by

no test coverage detected