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

Function TFE_OpGetOutputLength

tensorflow/c/eager/c_api.cc:869–891  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

867}
868
869TF_CAPI_EXPORT extern int TFE_OpGetOutputLength(TFE_Op* op,
870 const char* output_name,
871 TF_Status* status) {
872 const tensorflow::OpDef* op_def = GetOpDef(op, status);
873 if (!status->status.ok()) {
874 return -1;
875 }
876 tensorflow::AttrValueMap attrs;
877 op->operation.Attrs().FillAttrValueMap(&attrs);
878 tensorflow::NameRangeMap name_ranges;
879 status->status = tensorflow::NameRangesForNode(
880 tensorflow::AttrSlice(&attrs), *op_def, nullptr, &name_ranges);
881 if (!status->status.ok()) {
882 return -1;
883 }
884 auto iter = name_ranges.find(output_name);
885 if (iter == name_ranges.end()) {
886 status->status = tensorflow::errors::InvalidArgument(
887 "Output '", output_name, "' not found");
888 return -1;
889 }
890 return iter->second.second - iter->second.first;
891}
892
893void TFE_Execute(TFE_Op* op, TFE_TensorHandle** retvals, int* num_retvals,
894 TF_Status* status) {

Callers 2

TESTFunction · 0.85

Calls 9

NameRangesForNodeFunction · 0.85
AttrSliceClass · 0.85
InvalidArgumentFunction · 0.85
GetOpDefFunction · 0.70
okMethod · 0.45
FillAttrValueMapMethod · 0.45
AttrsMethod · 0.45
findMethod · 0.45
endMethod · 0.45

Tested by 1

TESTFunction · 0.68