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

Function reshape_from_matrix

examples/tensorflow/bert/utils/bert.py:313–322  ·  view source on GitHub ↗
(output_tensor, orig_shape_list)

Source from the content-addressed store, hash-verified

311
312
313def reshape_from_matrix(output_tensor, orig_shape_list):
314 if len(orig_shape_list) == 2:
315 return output_tensor
316
317 output_shape = get_shape_list(output_tensor)
318
319 orig_dims = orig_shape_list[0:-1]
320 width = output_shape[-1]
321
322 return tf.reshape(output_tensor, orig_dims + [width])
323
324
325def assert_rank(tensor, expected_rank, name=None):

Callers

nothing calls this directly

Calls 1

get_shape_listFunction · 0.70

Tested by

no test coverage detected