Skip to content

Instantly share code, notes, and snippets.

View daquexian's full-sized avatar
🎯
Focusing

daquexian daquexian

🎯
Focusing
  • OneFlow
  • China
View GitHub Profile
@daquexian
daquexian / generate-appimage.sh
Last active January 14, 2022 13:47
generate appimage out-of-the-box
#!/usr/bin/env bash
set -uexo pipefail
if [ ! -f linuxdeploy-x86_64.AppImage ]
then
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
fi
if [ ! -f linuxdeploy-plugin-appimage-x86_64.AppImage ]
then
@daquexian
daquexian / NETA_ZMORA_QDQ_is_all_you_need.pptx
Last active November 18, 2020 01:30
nvidia-onnx-qdq-pdf
This file has been truncated, but you can view the full file.
@daquexian
daquexian / check_onnx_resize_proposal_vs_tf_and_pytorch.py
Last active February 14, 2022 08:22
Check ONNX Resize Proposal against TF and PyTorch
import numpy as np # type: ignore
from typing import List, Callable, Union, Optional, Text
def cartesian(arrays, out=None):
# type: (List[np.ndarray], np.ndarray) -> np.ndarray
"""
From https://stackoverflow.com/a/1235363
Generate a cartesian product of input arrays.
@daquexian
daquexian / interpolation.py
Last active February 14, 2022 08:22
Linear and cubic interpolation
import numpy as np
from typing import List, Callable, Union, Optional
def cartesian(arrays, out=None):
# type: (List[np.ndarray], np.ndarray) -> np.ndarray
"""
From https://stackoverflow.com/a/1235363
@daquexian
daquexian / binary_conv.py
Last active February 6, 2022 16:20
A correct and dabnn-compatible binary convolution PyTorch implementation
# A correct and dabnn-compatible PyTorch implementation of binary convolutions.
# It consists of a implementation of the binary convolution itself, and the way
# to make the implementation both ONNX- and dabnn-compatible
# 1. The input of binary convolutions should only be +1/-1, so we pad -1 instead
# of 0 by a explicit pad operation.
# 2. Since PyTorch doesn't support exporting Sign ONNX operator (until
# https://github.com/pytorch/pytorch/pull/20470 gets merged), we perform sign
# operation on input and weight by directly accessing the `data`
import torch
@daquexian
daquexian / openpgp.txt
Created September 2, 2017 03:37
OpenKeychain Linked Identity
This Gist confirms the Linked Identity in my OpenPGP key, and links it to this GitHub account.
Token for proof:
[Verifying my OpenPGP key: openpgp4fpr:ae767adf33d6dbc2746ce7ec845a581542488b59]
@daquexian
daquexian / openpgp.txt
Created August 17, 2017 11:35
OpenKeychain 关联用户标识
This Gist confirms the Linked Identity in my OpenPGP key, and links it to this GitHub account.
Token for proof:
[Verifying my OpenPGP key: openpgp4fpr:ae767adf33d6dbc2746ce7ec845a581542488b59]
@daquexian
daquexian / openpgp.txt
Created August 13, 2017 11:46
OpenKeychain 关联用户标识
This Gist confirms the Linked Identity in my OpenPGP key, and links it to this GitHub account.
Token for proof:
[Verifying my OpenPGP key: openpgp4fpr:ae767adf33d6dbc2746ce7ec845a581542488b59]