Skip to content

Commit 4c0f0c2

Browse files
lingvo-botcopybara-github
authored andcommitted
Breaks internal targets
PiperOrigin-RevId: 489263779
1 parent 3c3df53 commit 4c0f0c2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lingvo/core/py_utils.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5290,7 +5290,11 @@ def ProjectLastDim(inputs, weight, input_dim, output_dim, use_einsum=True):
52905290
outputs = tf.einsum('{0}y,yz->{0}z'.format(s[:r - 1]), inputs, weight)
52915291
else:
52925292
# not use_einsum or not use_tpu() or inputs.shape.rank >= 26
5293-
outputs = tf.tensordot(inputs, weight, 1)
5293+
outputs = Matmul(tf.reshape(inputs, [-1, input_dim]), weight)
5294+
outputs = tf.reshape(
5295+
outputs,
5296+
tf.concat([tf.cast(GetShape(inputs)[:-1], tf.int32), [output_dim]],
5297+
axis=0))
52945298

52955299
return outputs
52965300

0 commit comments

Comments
 (0)