forked from openvinotoolkit/openvino
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PT FE] Support aten::softplus (openvinotoolkit#21367)
* [PT FE] Support aten::softplus * Fix name
- Loading branch information
Showing
2 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Copyright (C) 2018-2023 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
import pytest | ||
import torch | ||
|
||
from pytorch_layer_test_class import PytorchLayerTest | ||
|
||
|
||
class aten_softplus(torch.nn.Module): | ||
def forward(self, x): | ||
return torch.nn.functional.softplus(x) | ||
|
||
|
||
class TestSoftplus(PytorchLayerTest): | ||
def _prepare_input(self): | ||
import numpy as np | ||
return (np.random.randn(2, 4, 224, 224).astype(np.float32),) | ||
|
||
@pytest.mark.nightly | ||
@pytest.mark.precommit | ||
def test_softplus(self, ie_device, precision, ir_version): | ||
self._test(aten_softplus(), None, "aten::softplus", | ||
ie_device, precision, ir_version) |