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

Method CopyOp

tensorflow/core/kernels/debug_ops.h:39–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37class CopyOp : public OpKernel {
38 public:
39 explicit CopyOp(OpKernelConstruction* context) : OpKernel(context) {
40 OP_REQUIRES_OK(context, context->GetAttr("tensor_name", &tensor_name_));
41
42 std::vector<string> debug_ops_spec;
43 OP_REQUIRES_OK(context,
44 context->GetAttr("debug_ops_spec", &debug_ops_spec));
45 for (const string& debug_op_spec : debug_ops_spec) {
46 // Assume debug_op_spec has the format
47 // <debug_op>;<debug_url>;<gated_grpc>, e.g.,
48 // DebugIdentity;grpc://localhost:3333;1
49 const std::vector<string> items = str_util::Split(debug_op_spec, ";");
50 OP_REQUIRES(
51 context, items.size() == 3,
52 errors::Internal(
53 "Unexpected number of semicolons in debug_ops_spec element: ",
54 debug_op_spec));
55 debug_op_and_url_specs_.push_back(
56 DebugWatchAndURLSpec(strings::StrCat(tensor_name_, ":", items[0]),
57 items[1], items[2] == "1"));
58 }
59 }
60
61 void Compute(OpKernelContext* context) override {
62 const Tensor& src_tensor = context->input(0);

Callers

nothing calls this directly

Calls 7

InternalFunction · 0.85
SplitClass · 0.70
StrCatFunction · 0.50
GetAttrMethod · 0.45
sizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected