| 360 | } |
| 361 | |
| 362 | func newCRunArgs(feeds map[Output]*Tensor, fetches []Output, targets []*Operation) *cRunArgs { |
| 363 | c := &cRunArgs{ |
| 364 | fetches: make([]C.TF_Output, len(fetches)), |
| 365 | fetchTensors: make([]*C.TF_Tensor, len(fetches)), |
| 366 | targets: make([]*C.TF_Operation, len(targets)), |
| 367 | } |
| 368 | for o, t := range feeds { |
| 369 | c.feeds = append(c.feeds, o.c()) |
| 370 | c.feedTensors = append(c.feedTensors, t.c) |
| 371 | } |
| 372 | for i, o := range fetches { |
| 373 | c.fetches[i] = o.c() |
| 374 | } |
| 375 | for i, t := range targets { |
| 376 | c.targets[i] = t.c |
| 377 | } |
| 378 | return c |
| 379 | } |
| 380 | |
| 381 | func (c *cRunArgs) toGo() []*Tensor { |
| 382 | ret := make([]*Tensor, len(c.fetchTensors)) |