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

Method Run

tensorflow/go/session.go:182–206  ·  view source on GitHub ↗

Run resumes execution of the graph to compute the requested fetches and targets with the provided feeds.

(feeds map[Output]*Tensor, fetches []Output, targets []*Operation)

Source from the content-addressed store, hash-verified

180// Run resumes execution of the graph to compute the requested fetches and
181// targets with the provided feeds.
182func (pr *PartialRun) Run(feeds map[Output]*Tensor, fetches []Output, targets []*Operation) ([]*Tensor, error) {
183 var (
184 c = newCRunArgs(feeds, fetches, targets)
185 status = newStatus()
186 s = pr.session
187 )
188 s.mu.Lock()
189 if s.c == nil {
190 s.mu.Unlock()
191 return nil, errors.New("session is closed")
192 }
193 s.wg.Add(1)
194 s.mu.Unlock()
195 defer s.wg.Done()
196
197 C.TF_SessionPRun(s.c, pr.handle,
198 ptrOutput(c.feeds), ptrTensor(c.feedTensors), C.int(len(feeds)),
199 ptrOutput(c.fetches), ptrTensor(c.fetchTensors), C.int(len(fetches)),
200 ptrOperation(c.targets), C.int(len(targets)),
201 status.c)
202 if err := status.Err(); err != nil {
203 return nil, err
204 }
205 return c.toGo(), nil
206}
207
208// NewPartialRun sets up the graph for incremental evaluation.
209//

Callers 1

ExamplePartialRunFunction · 0.95

Calls 12

newCRunArgsFunction · 0.85
newStatusFunction · 0.85
ptrOutputFunction · 0.85
ptrTensorFunction · 0.85
ptrOperationFunction · 0.85
LockMethod · 0.80
UnlockMethod · 0.80
toGoMethod · 0.80
NewMethod · 0.45
AddMethod · 0.45
DoneMethod · 0.45
ErrMethod · 0.45

Tested by 1

ExamplePartialRunFunction · 0.76