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

Function Const

tensorflow/go/util_test.go:30–47  ·  view source on GitHub ↗
(g *Graph, name string, value interface{})

Source from the content-addressed store, hash-verified

28}
29
30func Const(g *Graph, name string, value interface{}) (Output, error) {
31 t, ok := value.(*Tensor)
32 if !ok {
33 var err error
34 if t, err = NewTensor(value); err != nil {
35 return Output{}, err
36 }
37 }
38 op, err := g.AddOperation(OpSpec{
39 Type: "Const",
40 Name: name,
41 Attrs: map[string]interface{}{
42 "dtype": t.DataType(),
43 "value": t,
44 },
45 })
46 return op.Output(0), err
47}
48
49func Neg(g *Graph, name string, port Output) (Output, error) {
50 op, err := g.AddOperation(OpSpec{

Callers

nothing calls this directly

Calls 4

NewTensorFunction · 0.85
AddOperationMethod · 0.45
DataTypeMethod · 0.45
OutputMethod · 0.45

Tested by

no test coverage detected