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.
[JAX FE]: add support for jax.lax.logistic (openvinotoolkit#28240)
**Overview:** This PR fixes openvinotoolkit#26576. **Testing:** - Tested the Updated code - Verified that other functionalities remain unaffected ![Screenshot from 2025-01-01 13-11-04](https://github.com/user-attachments/assets/5acfabc2-dded-4c65-b408-d4174fa3c025) **Dependencies:** - No dependencies on other pull requests **CC:** - @rkazants --------- Signed-off-by: 11happy <[email protected]> Co-authored-by: Roman Kazantsev <[email protected]>
- Loading branch information
Showing
2 changed files
with
39 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,37 @@ | ||
# Copyright (C) 2018-2024 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
import jax | ||
import numpy as np | ||
import pytest | ||
from jax import numpy as jnp | ||
|
||
from jax_layer_test_class import JaxLayerTest | ||
|
||
rng = np.random.default_rng(5402) | ||
|
||
|
||
class TestLogistic(JaxLayerTest): | ||
def _prepare_input(self): | ||
|
||
input = jnp.array(np.random.uniform(-1000, 1000, self.input_shape).astype(self.input_type)) | ||
return [input] | ||
|
||
def create_model(self, input_shape, input_type): | ||
self.input_shape = input_shape | ||
self.input_type = input_type | ||
|
||
def jax_logistic(input): | ||
return jax.lax.logistic(input) | ||
|
||
return jax_logistic, None, 'logistic' | ||
|
||
@pytest.mark.parametrize("input_shape", [[2], [3, 4], [5,6,7]]) | ||
@pytest.mark.parametrize("input_type", [np.float32, np.float64]) | ||
@pytest.mark.nightly | ||
@pytest.mark.precommit | ||
@pytest.mark.precommit_jax_fe | ||
def test_logistic(self, ie_device, precision, ir_version, input_shape, input_type): | ||
self._test(*self.create_model(input_shape, input_type), | ||
ie_device, precision, | ||
ir_version) |