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

Function ComputeArgRange

tensorflow/core/framework/node_def_util.cc:681–698  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

679namespace { // Helpers for NameRangesForNode()
680
681Status ComputeArgRange(const AttrSlice& attrs, const OpDef::ArgDef& arg_def,
682 const OpDef& op_def, int* num) {
683 if (!arg_def.number_attr().empty()) {
684 // Same type repeated "num" times.
685 return GetNodeAttr(attrs, arg_def.number_attr(), num);
686 } else if (!arg_def.type_list_attr().empty()) {
687 const AttrValue* attr_value;
688 TF_RETURN_IF_ERROR(attrs.Find(arg_def.type_list_attr(), &attr_value));
689 *num = attr_value->list().type_size();
690 } else if (!arg_def.type_attr().empty() || arg_def.type() != DT_INVALID) {
691 *num = 1;
692 } else {
693 return errors::InvalidArgument(
694 "Argument '", arg_def.name(),
695 "' incorrectly specified in op definition: ", SummarizeOpDef(op_def));
696 }
697 return Status::OK();
698}
699
700Status NameRangesHelper(const AttrSlice& attrs,
701 const protobuf::RepeatedPtrField<OpDef::ArgDef>& args,

Callers 1

NameRangesHelperFunction · 0.85

Calls 8

InvalidArgumentFunction · 0.85
SummarizeOpDefFunction · 0.85
listMethod · 0.80
typeMethod · 0.65
nameMethod · 0.65
GetNodeAttrFunction · 0.50
emptyMethod · 0.45
FindMethod · 0.45

Tested by

no test coverage detected