Skip to content

Commit

Permalink
Remove dependency on Python3
Browse files Browse the repository at this point in the history
  • Loading branch information
soiferj committed Aug 8, 2019
1 parent 630af55 commit d0a4cd4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions python/tvm/relay/frontend/tensorflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

import warnings
from collections import defaultdict
from functools import reduce
# Numpy support
import numpy as np

Expand Down Expand Up @@ -457,7 +456,10 @@ def _impl(inputs, attr, params):
# reshape n-dimensional batch matmul into 3d
if len(orig_shape_x) > 3:
outer_dims = [orig_shape_x[i] for i in range(0, len(orig_shape_x) - 2)]
num_outer_elts = reduce((lambda x, y: x * y), outer_dims)
num_outer_elts = 1
for outer_dim in outer_dims:
num_outer_elts *= outer_dim

new_shape_x = (num_outer_elts, orig_shape_x[-2], orig_shape_x[-1])
new_shape_y = (num_outer_elts, orig_shape_y[-2], orig_shape_y[-1])
input_x = _op.reshape(input_x, newshape=new_shape_x)
Expand Down

0 comments on commit d0a4cd4

Please sign in to comment.