ashutosh-arm commented on code in PR #13522: URL: https://github.com/apache/tvm/pull/13522#discussion_r1040981648
########## tests/python/relay/aot/test_crt_forward_declarations.py: ########## @@ -0,0 +1,325 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +"""test forward function declarations codegen by CodegenCHost.""" + +from collections import OrderedDict +import pytest +import numpy as np + +import tvm.testing +from tvm import relay +from tvm.contrib.download import download_testdata +from tvm.relay.op.contrib import cmsisnn +from tvm.testing.aot import AOTTestModel, compile_models, generate_ref_data +from tvm.micro.testing.aot_test_utils import ( + AOT_CORSTONE300_RUNNER, + AOT_USMP_CORSTONE300_RUNNER, + parametrize_aot_options, + AOTTestRunner, +) + + +def skip_if_no_reference_system(func): + return tvm.testing.skip_if_32bit(reason="Reference system unavailable in i386 container")(func) + + +def get_range_for_dtype_str(dtype): + """ + Produces the min,max for a give data type. + + Parameters + ---------- + dtype : str + a type string (e.g., int8) + + Returns + ------- + type_info.min : int + the minimum of the range + type_info.max : int + the maximum of the range + """ + + try: + type_info = np.iinfo(dtype) + except ValueError: + type_info = np.finfo(dtype) + return type_info.min, type_info.max + + +# pylint: disable=import-outside-toplevel +def _convert_to_relay( Review Comment: I have extended that class to load from file. Thanks for the suggestion :partying_face: -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
