MCPcopy Create free account
hub / github.com/NVIDIA/FasterTransformer / pad_in_time

Function pad_in_time

examples/tensorflow/bert/utils/reducer.py:18–20  ·  view source on GitHub ↗

Helper function to pad a tensor in the time dimension and retain the static depth dimension.

(x, padding_length)

Source from the content-addressed store, hash-verified

16import tensorflow as tf
17
18def pad_in_time(x, padding_length):
19 """Helper function to pad a tensor in the time dimension and retain the static depth dimension."""
20 return tf.pad(x, [[0, 0], [0, padding_length], [0, 0]])
21
22
23def align_in_time(x, length):

Callers 2

align_in_timeFunction · 0.70
pad_with_identityFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected