Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion hummingbird/ml/containers/_sklearn_api_containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def _run(self, function, *inputs):
splits = [inputs[input_names[idx]] for idx in range(len(input_names))]
inputs = [df.to_numpy().reshape(-1, 1) for df in splits]

return function(*inputs)
return function(inputs)


class SklearnContainerTransformer(SklearnContainer):
Expand Down
4 changes: 1 addition & 3 deletions hummingbird/ml/containers/sklearn/pytorch_containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,6 @@ def _predict(self, *inputs):
return output
else:
return output.ravel()
elif self._is_anomaly_detection:
return self.model.forward(*inputs)[0].cpu().numpy().ravel()
else:
return self.model.forward(*inputs)[0].cpu().numpy().ravel()

Expand Down Expand Up @@ -282,7 +280,7 @@ class TorchScriptSklearnContainerClassification(PyTorchSklearnContainerClassific
def predict(self, *inputs):
device = get_device(self.model)
f = super(TorchScriptSklearnContainerClassification, self)._predict
f_wrapped = lambda x: _torchscript_wrapper(device, f, x, extra_config=self._extra_config) # noqa: E731
f_wrapped = lambda x: _torchscript_wrapper(device, f, *x, extra_config=self._extra_config) # noqa: E731

return self._run(f_wrapped, *inputs)

Expand Down