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

Method RegisterDeviceCopyFn

tensorflow/core/framework/variant_op_registry.cc:113–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111}
112
113void UnaryVariantOpRegistry::RegisterDeviceCopyFn(
114 const VariantDeviceCopyDirection direction, const TypeIndex& type_index,
115 const AsyncVariantDeviceCopyFn& device_copy_fn) {
116 AsyncVariantDeviceCopyFn* existing = GetDeviceCopyFn(direction, type_index);
117 CHECK_EQ(existing, nullptr)
118 << "UnaryVariantDeviceCopy for direction: " << direction
119 << " and type_index: " << port::MaybeAbiDemangle(type_index.name())
120 << " already registered";
121 device_copy_fns.insert(
122 std::pair<std::pair<VariantDeviceCopyDirection, TypeIndex>,
123 AsyncVariantDeviceCopyFn>(std::make_pair(direction, type_index),
124 device_copy_fn));
125}
126
127Status VariantDeviceCopy(
128 const VariantDeviceCopyDirection direction, const Variant& from,

Callers 2

TESTFunction · 0.80

Calls 3

MaybeAbiDemangleFunction · 0.85
nameMethod · 0.65
insertMethod · 0.45

Tested by 1

TESTFunction · 0.64