Skip to content

Instantly share code, notes, and snippets.

View zh794390558's full-sized avatar

Hui Zhang zh794390558

  • baidu
  • beijing
View GitHub Profile
@zh794390558
zh794390558 / mm.cu
Created May 10, 2023 06:10 — forked from leimao/mm.cu
Matrix Multiplication and Batched Matrix Multiplication Implementations Using C++ and CUDA.
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <iomanip>
#include <iostream>
#include <random>
#include <stdexcept>
#include <vector>
#define BLOCK_DIM 32
@zh794390558
zh794390558 / tfcompile.ipynb
Created March 22, 2019 06:42 — forked from carlthome/tfcompile.ipynb
Example of how to use XLA AOT via tfcompile to build a Keras model into a shared library.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@zh794390558
zh794390558 / dir_walk_with_depth_control.py
Created September 1, 2018 11:35 — forked from bpeterso2000/dir_walk_with_depth_control.py
Recursively walk a directory to a specified depth
" Reference: http://stackoverflow.com/questions/7159607 "
import os
import sys
def listdir(path):
"""
recursively walk directory to specified depth
:param path: (str) path to list files from
# This file is useful for reading the contents of the ops generated by ruby.
# You can read any graph defination in pb/pbtxt format generated by ruby
# or by python and then convert it back and forth from human readable to binary format.
import tensorflow as tf
from google.protobuf import text_format
from tensorflow.python.platform import gfile
def pbtxt_to_graphdef(filename):
with open(filename, 'r') as f:
@zh794390558
zh794390558 / audio_tools.py
Created July 11, 2017 09:28 — forked from kastnerkyle/audio_tools.py
Audio tools for numpy/python. Constant work in progress.
raise ValueError("DEPRECATED/FROZEN - see https://github.com/kastnerkyle/tools for the latest")
# License: BSD 3-clause
# Authors: Kyle Kastner
# Harvest, Cheaptrick, D4C, WORLD routines based on MATLAB code from M. Morise
# http://ml.cs.yamanashi.ac.jp/world/english/
# MGC code based on r9y9 (Ryuichi Yamamoto) MelGeneralizedCepstrums.jl
# Pieces also adapted from SPTK
from __future__ import division
import numpy as np
development:
adapter: mysql2
encoding: utf8
database: my_database
username: root
roles:
- admin
- developer
- guest
password:
@zh794390558
zh794390558 / .clang-format
Created August 23, 2016 11:00 — forked from kristopherjohnson/.clang-format
Script that runs clang-format on files in a set of directories
BasedOnStyle: Webkit
BreakBeforeBraces: Allman
BreakConstructorInitializersBeforeComma: false
ConstructorInitializerAllOnOneLineOrOnePerLine: true
Cpp11BracedListStyle: true
IndentCaseLabels: true
MaxEmptyLinesToKeep: 2
PointerBindsToType: false
SpacesBeforeTrailingComments: 2
Standard: Cpp11