(g *Graph, name string, value interface{})
| 28 | } |
| 29 | |
| 30 | func 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 | |
| 49 | func Neg(g *Graph, name string, port Output) (Output, error) { |
| 50 | op, err := g.AddOperation(OpSpec{ |
nothing calls this directly
no test coverage detected