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

Method BaseDebugOp

tensorflow/core/kernels/debug_ops.h:121–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

119class BaseDebugOp : public OpKernel {
120 public:
121 explicit BaseDebugOp(const string& debug_op_name,
122 OpKernelConstruction* context)
123 : OpKernel(context), debug_op_name_(debug_op_name) {
124 OP_REQUIRES_OK(context, context->GetAttr("debug_urls", &debug_urls_));
125 OP_REQUIRES_OK(context, context->GetAttr("gated_grpc", &gated_grpc_));
126
127 string device_name;
128 string tensor_name;
129 OP_REQUIRES_OK(context, context->GetAttr("device_name", &device_name));
130 OP_REQUIRES_OK(context, context->GetAttr("tensor_name", &tensor_name));
131
132 std::vector<string> name_items = str_util::Split(tensor_name, ':');
133 string node_name;
134 int32 output_slot = 0;
135 OP_REQUIRES(context, name_items.size() == 1 || name_items.size() == 2,
136 errors::InvalidArgument("Failed to parse tensor name: \"",
137 tensor_name, "\""));
138 if (name_items.size() == 2) {
139 node_name = name_items[0];
140 OP_REQUIRES(
141 context, strings::safe_strto32(name_items[1], &output_slot),
142 errors::InvalidArgument("Invalid string value for output_slot: \"",
143 name_items[1], "\""));
144 } else if (name_items.size() == 1) {
145 node_name = name_items[0];
146 }
147
148 debug_watch_key_.reset(
149 new DebugNodeKey(device_name, node_name, output_slot, debug_op_name_));
150 }
151
152 bool IsExpensive() override { return false; }
153

Callers

nothing calls this directly

Calls 6

InvalidArgumentFunction · 0.85
SplitClass · 0.70
safe_strto32Function · 0.50
GetAttrMethod · 0.45
sizeMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected