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

Function swap_batch_timestep

tensorflow/python/keras/backend.py:3785–3789  ·  view source on GitHub ↗
(input_t)

Source from the content-addressed store, hash-verified

3783 """
3784
3785 def swap_batch_timestep(input_t):
3786 # Swap the batch and timestep dim for the incoming tensor.
3787 axes = list(range(len(input_t.shape)))
3788 axes[0], axes[1] = 1, 0
3789 return array_ops.transpose(input_t, axes)
3790
3791 if not time_major:
3792 inputs = nest.map_structure(swap_batch_timestep, inputs)

Callers 1

rnnFunction · 0.85

Calls 2

transposeMethod · 0.80
rangeFunction · 0.50

Tested by

no test coverage detected