Skip to content

Instantly share code, notes, and snippets.

/* Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
;;; phabricator.el --- Phabricator/Arcanist helpers for Emacs.
;; Author: Andrew Tulloch
;; URL: https://github.com/ajtulloch/phabricator.el
;; Version: 0.1
;; Created: 2014-09-11
;; Keywords: phabricator, arcanist, diffusion
;; Package-Requires: ((emacs "24.1") (ido "0.1") (projectile "0.1") (dash "0.1"))
;; This file is NOT part of GNU Emacs.
class SVMTrainer(object):
def __init__(self, kernel, c):
self._kernel = kernel
self._c = c
def train(self, X, y):
"""Given the training features X with labels y, returns a SVM
predictor representing the trained SVM.
"""
lagrange_multipliers = self._compute_multipliers(X, y)
@ajtulloch
ajtulloch / Untitled60.ipynb
Last active December 6, 2019 21:10
nn.Linear error analysis
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ajtulloch
ajtulloch / Block-Sparse GEMM.ipynb
Last active August 28, 2019 12:07
Block-Sparse GEMM.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/usr/bin/env python
import svmpy
import logging
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import itertools
import argh
from tvm import relay
from mxnet.gluon import nn
import mxnet as mx
class TestBlock(nn.HybridBlock):
def __init__(self):
super(TestBlock, self).__init__()
self.conv = nn.Conv2D(8, 3, 1, 1, use_bias=False)
self.a000 = nn.Activation("relu")
self.a0_0 = nn.MaxPool2D(pool_size=2, strides=2)
diff --git a/src/relay/pass/quantize.cc b/src/relay/pass/quantize.cc
index 3a2e54c8..4059dc3a 100644
--- a/src/relay/pass/quantize.cc
+++ b/src/relay/pass/quantize.cc
@@ -340,18 +340,9 @@ Expr MulRealize(const Call& ref_call,
const auto* rhs = new_args[1].as<QRealizeIntExprNode>();
Expr ldata = lhs->data;
Expr rdata = rhs->data;
-
DataType dtype = cfg->dtype_activation;
@ajtulloch
ajtulloch / Untitled.ipynb
Created June 7, 2019 21:45
Untitled.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ajtulloch
ajtulloch / Untitled41.ipynb
Last active April 30, 2019 02:49
RelayTVMFusionE2E.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.