MCPcopy Index your code
hub / github.com/pytorch/pytorch / TaskOutputList

Class TaskOutputList

caffe2/python/task.py:412–436  ·  view source on GitHub ↗

Keeps a list of outputs for a task

Source from the content-addressed store, hash-verified

410
411
412class TaskOutputList:
413 """ Keeps a list of outputs for a task """
414 def __init__(self, outputs=None):
415 self.outputs = outputs or []
416
417 def names(self):
418 """
419 Retrive the output names.
420 TODO(azzolini): make this schema-based.
421 """
422 names = []
423 for o in self.outputs:
424 names += o.names
425 return names
426
427 def set_values(self, values, _fetch_func=None):
428 offset = 0
429 for o in self.outputs:
430 num = len(o.names)
431 o.set(values[offset:offset + num], _fetch_func)
432 offset += num
433 assert offset == len(values), 'Wrong number of output values.'
434
435 def __repr__(self):
436 return "TaskOutputList(outputs={})".format(self.outputs)
437
438
439class Task(context.Managed):

Callers 1

output_listMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…