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

Function GetAPIDef

tensorflow/go/genop/internal/genop_test.go:30–45  ·  view source on GitHub ↗

Creates an ApiDef based on opdef and applies overrides from apidefText (ApiDef text proto).

(t *testing.T, opdef *pb.OpDef, apidefText string)

Source from the content-addressed store, hash-verified

28// Creates an ApiDef based on opdef and applies overrides
29// from apidefText (ApiDef text proto).
30func GetAPIDef(t *testing.T, opdef *pb.OpDef, apidefText string) *pb.ApiDef {
31 opdefList := &pb.OpList{Op: []*pb.OpDef{opdef}}
32 apimap, err := newAPIDefMap(opdefList)
33 if err != nil {
34 t.Fatal(err)
35 }
36 err = apimap.Put(apidefText)
37 if err != nil {
38 t.Fatal(err)
39 }
40 apidef, err := apimap.Get(opdef.Name)
41 if err != nil {
42 t.Fatal(err)
43 }
44 return apidef
45}
46
47func TestGenerateOp(t *testing.T) {
48 // TestGenerateOp validates the generated source code for an op.

Callers 1

TestGenerateOpFunction · 0.85

Calls 3

newAPIDefMapFunction · 0.85
PutMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected