Skip to content

Instantly share code, notes, and snippets.

View mbrookhart's full-sized avatar

Matthew Brookhart mbrookhart

  • Salt Lake City, UT
View GitHub Profile
@mbrookhart
mbrookhart / mobilebert_accuracy_error.py
Created June 14, 2021 21:38
Test script for mobilebert onnx accuracy
import onnx
import tensorflow as tf
import onnxruntime.backend
import transformers
import numpy as np
import argparse
import time
tokenizer = transformers.BertTokenizer.from_pretrained("google/mobilebert-uncased")
output = tokenizer("""
import tvm
from tvm import relay
from tvm.contrib import graph_runtime
import numpy as np
shapes = [
[(2000, 2, 2), 0],
[(2, 2000, 2), 1],
[(2, 2, 2000), 2],
# 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
#