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

Function generateFunctionsForOps

tensorflow/go/genop/internal/genop.go:107–130  ·  view source on GitHub ↗
(w io.Writer, ops *pb.OpList, apimap *apiDefMap)

Source from the content-addressed store, hash-verified

105}
106
107func generateFunctionsForOps(w io.Writer, ops *pb.OpList, apimap *apiDefMap) error {
108 thisPackage := reflect.TypeOf(tmplArgs{}).PkgPath()
109 if err := tmplHeader.Execute(w, thisPackage); err != nil {
110 return err
111 }
112 blacklist := map[string]bool{
113 "Const": true,
114 "PyFunc": true,
115 "PyFuncStateless": true,
116 }
117 for _, op := range ops.Op {
118 if blacklist[op.Name] {
119 continue
120 }
121 apidef, err := apimap.Get(op.Name)
122 if err != nil {
123 return err
124 }
125 if err := generateFunctionForOp(w, op, apidef); err != nil {
126 return err
127 }
128 }
129 return nil
130}
131
132func generateFunctionForOp(w io.Writer, op *pb.OpDef, apidef *pb.ApiDef) error {
133 if strings.HasPrefix(op.Name, "_") { // Internal operation

Callers 1

Calls 4

generateFunctionForOpFunction · 0.85
TypeOfMethod · 0.80
ExecuteMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected