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

Method unpack

tensorpack/graph_builder/utils.py:438–444  ·  view source on GitHub ↗
(self, grad_packs)

Source from the content-addressed store, hash-verified

436 return grad_packs
437
438 def unpack(self, grad_packs):
439 with cached_name_scope("GradientPacker", top_level=False):
440 concat_grads = tf.concat(grad_packs, 0, name='concatenated_packs')
441 # concat_grads = tf.cast(concat_grads, self._grad_dtype)
442 flattened_grads = tf.split(concat_grads, self._sizes)
443 grads = [tf.reshape(g, shape) for g, shape in zip(flattened_grads, self._shapes)]
444 return grads
445
446 def pack_all(self, all_grads, devices):
447 """

Callers 1

unpack_allMethod · 0.95

Calls 1

cached_name_scopeFunction · 0.85

Tested by

no test coverage detected