Skip to content

Instantly share code, notes, and snippets.

View maxwillzq's full-sized avatar

John maxwillzq

  • Google
View GitHub Profile
@maxwillzq
maxwillzq / test_backend.py
Created February 16, 2024 01:55
jaxonnxruntime test_backend.py for score_board
"""ONNX backend test initialization."""
# copy from: https://github.com/onnx/backend-scoreboard/blob/master/test/test_backend.py
# Cmd: pytest test_backend.py -k 'not _cuda' --tb=short
import importlib
import os
import unittest
import onnx.backend.test
============================= test session starts ==============================
platform linux -- Python 3.11.4, pytest-7.4.0, pluggy-1.2.0
rootdir: /usr/local/google/home/johnqiangzhang/Documents/jaxonnxruntime
configfile: pyproject.toml
collected 3924 items
tests/onnx_ops_test.py .ss..ssss..ssssFsFsssFsFsss.ss.ss.ssFssFss.ss.ss. [ 1%]
ss.ss.ss.ss.ss.ss.s.sss.s.sss.s.sss.s.sss.s.sss.s.sss.s.sss.s.sss.s.sss. [ 3%]
s.sss.s.sss.s.sss.s.sss.s.sss.s.sss.s.sss..ssss..ssss..ssss..ssss.ssxss. [ 4%]
ssxss.ss.ss.ss.ss.ss.ss.ss.ss.ss.ss.ss.ss.ss.ss.ss.ss.ss.ss...ssss.sss.. [ 6%]
#!/usr/bin/python3
import numpy as np
import onnx
import os
import sys
import json
from google.protobuf.json_format import MessageToJson
from google.protobuf.json_format import Parse
import torch
import torch.onnx
int indexToLoc(const vector<int>& strides, vector<int> ids){
int result = 0;
for(int i = 0; i < strides.size(); i++) {
result += ids[i] * strides[i];
}
return result;
}
vector<int> locToIndex(const vector<int>& strides, int loc) {
vector<int> result;
@maxwillzq
maxwillzq / ASMLStock.ipynb
Created January 22, 2014 19:16
Example for the QSTK package
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# -*- coding: utf-8 -*-
"""
Created on Wed Jan 02 11:03:42 2013
@author: qzhang
"""
import functools
a = [ 1,50,2,4,16]
def MyCmp(x,y):
# -*- coding: utf-8 -*-
"""
Created on Tue Jan 01 17:24:03 2013
@author: qzhang
"""
import functools
def myfunc(a, b=2):
# -*- coding: utf-8 -*-
string = u"page=/web/mini_f21/site/index.jsp,0.0,\
pagetitle=博世家电-户外全能™系列洗衣机,\
pagetag=,pagedomain=minisite.bosch-home.cn,|page=/virtual/主页,122.0,\
pagetitle=博世家电-户外全能™系列洗衣机,pagetag=,\
pagedomain=minisite.bosch-home.cn,|page=/web/mini_f21/site/index.jsp,36.0,\
pagetitle=博世家电-户外全能™系列洗衣机,\
pagetag=,pagedomain=minisite.bosch-home.cn,\
|page=/virtual/主页,62.0,pagetitle=博世家电-户外全能™系列洗衣机,\
@maxwillzq
maxwillzq / 0_reuse_code.js
Created October 13, 2013 00:33
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console