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

Function UnaryOpVariant

tensorflow/core/framework/variant_op_registry.h:265–276  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

263//
264template <typename Device>
265Status UnaryOpVariant(OpKernelContext* ctx, VariantUnaryOp op, const Variant& v,
266 Variant* v_out) {
267 const string& device = DeviceName<Device>::value;
268 UnaryVariantOpRegistry::VariantUnaryOpFn* unary_op_fn =
269 UnaryVariantOpRegistry::Global()->GetUnaryOpFn(op, device, v.TypeId());
270 if (unary_op_fn == nullptr) {
271 return errors::Internal(
272 "No unary variant unary_op function found for unary variant op enum: ",
273 op, " Variant type_name: ", v.TypeName(), " for device type: ", device);
274 }
275 return (*unary_op_fn)(ctx, v, v_out);
276}
277
278// Sets *out = binary_op(a, b). The variants a and b must be the same type
279// and have a registered binary_op function for the given Device. Returns an

Callers

nothing calls this directly

Calls 4

InternalFunction · 0.85
GetUnaryOpFnMethod · 0.80
TypeIdMethod · 0.45
TypeNameMethod · 0.45

Tested by

no test coverage detected