Created
October 13, 2022 17:50
-
-
Save pashu123/6427910d2b6b4e53ae2a1fb45362f34d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import numpy as np | |
from shark.shark_inference import SharkInference | |
from shark.shark_importer import SharkImporter | |
from shark.shark_downloader import download_torch_model | |
mlir_model, func_name, inputs, golden_out = download_torch_model( | |
"resnet_50_fp16_old", tank_url="gs://shark_tank/prashant_nod" | |
) | |
shark_module = SharkInference(mlir_model, func_name, mlir_dialect="linalg") | |
shark_module.compile() | |
result = shark_module.forward(inputs) | |
np.testing.assert_allclose(golden_out, result, rtol=1e-02, atol=1e-03) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment