Skip to content

Commit ccc3189

Browse files
committed
add einsum support to pytorch parser
1 parent c237ccc commit ccc3189

2 files changed

Lines changed: 0 additions & 3 deletions

File tree

hls4ml/converters/pytorch/core.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@ def parse_batchnorm_layer(operation, layer_name, input_names, input_shapes, node
158158

159159
return layer, [shape for shape in input_shapes[0]]
160160

161-
162161
@pytorch_handler('einsum')
163162
def parse_einsum_layer(operation, layer_name, input_names, input_shapes, node, class_object, data_reader, config):
164163
assert 'einsum' in operation

test/pytest/test_pytorch_api.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -878,15 +878,13 @@ def forward(self, x):
878878
atol = 5.0e-2
879879
np.testing.assert_allclose(hls_prediction, pytorch_prediction, rtol=rtol, atol=atol)
880880

881-
882881
class EinsumOuterProduct(nn.Module):
883882
def __init__(self):
884883
super().__init__()
885884

886885
def forward(self, x, y):
887886
return torch.einsum('bi,bj->bij', x, y)
888887

889-
890888
class EinsumBatchMatMul(nn.Module):
891889
def __init__(self):
892890
super().__init__()

0 commit comments

Comments
 (0)