MCPcopy Index your code
hub / github.com/tensorpack/tensorpack / get_tensor

Method get_tensor

tensorpack/callbacks/base.py:233–245  ·  view source on GitHub ↗
(name)

Source from the content-addressed store, hash-verified

231 from ..train.tower import TowerTrainer # noqa
232
233 def get_tensor(name):
234 msg = "Tensor {} not found in the graph!".format(name)
235 try:
236 return get_op_or_tensor_by_name(name)
237 except KeyError:
238 pass
239 if not isinstance(self.trainer, TowerTrainer):
240 raise KeyError(msg)
241 towers = self.trainer.towers
242 try:
243 return towers.training()[0][name]
244 except KeyError:
245 raise KeyError(msg)
246 return [get_tensor(name) for name in names]
247
248

Callers

nothing calls this directly

Calls 3

get_op_or_tensor_by_nameFunction · 0.85
formatMethod · 0.80
trainingMethod · 0.45

Tested by

no test coverage detected