Skip to content

Instantly share code, notes, and snippets.

class ApplyCudaGraphs(torch.fx.Interpreter):
def call_module(self, target, args, kwargs):
assert not kwargs
submod = self.module.get_submodule(target)
self.module.delete_submodule(target)
mutated_inputs = FindInputMutations(submod)(*args)
self.module.add_submodule(target, CudaGraphModule(submod, mutated_inputs))
r = super().call_module(target, args, kwargs)
return r
@olabi
olabi / .block
Created December 5, 2018 04:52 — forked from d3indepth/.block
Symbol types
license: gpl-3.0
height: 80
border: no
@olabi
olabi / Award Partial Credit.py
Last active November 19, 2018 00:41
loncapa/python
<problem>
<script type="loncapa/python">
# -*- coding: utf-8 -*-
def checkResult(expect, rAnswer):
# 정답을 정의
aCorrectAnswer = [
[u'aaa', u'가나다'],
[u'bbb', u'나대다'],
[u'ccc', u'홍길동']
]
@olabi
olabi / force.csv
Created October 24, 2018 06:18 — forked from d3noob/.block
Basic Directional Force Layout Diagram
source target value
Harry Sally 1.2
Harry Mario 1.3
Sarah Alice 0.2
Eveie Alice 0.5
Peter Alice 1.6
Mario Alice 0.4
James Alice 0.6
Harry Carol 0.7
Harry Nicky 0.8
@olabi
olabi / .block
Last active October 18, 2018 05:08 — forked from mbostock/.block
시간표(2018학년도 2학기)
license: gpl-3.0
@olabi
olabi / README.md
Created October 18, 2018 00:43 — forked from mstanaland/README.md
Stacked bar chart with tooltips

A simple stacked coloumn graph built using d3's stack layout.

The SVG tooltip is based on this gist by Mike Bostock. In short, the tooltip's group, comprised of a rect and a text element, are created when the chart is first drawn and set to be hidden. Action is applied to the stacks' rects: on mouseover the group become visible; on mousemove the mouse's XY position is captured and used to transform/translate the group.

If you ajust the tooltip's XY offset, keep in mind that there can be no overlap between the group and the mouse's position or the group's visibility will remain hidden.

@olabi
olabi / .block
Last active October 31, 2018 07:29 — forked from mbostock/.block
Population Pyramid
license: gpl-3.0
@olabi
olabi / .block
Last active October 31, 2018 07:32 — forked from mbostock/.block
Stacked-to-Grouped Bars
license: gpl-3.0
@olabi
olabi / d3.phylogram.js
Created July 16, 2018 01:40 — forked from kueda/d3.phylogram.js
Right-angle phylograms and circular dendrograms with d3. To preview see http://bl.ocks.org/kueda/1036776
/*
d3.phylogram.js
Wrapper around a d3-based phylogram (tree where branch lengths are scaled)
Also includes a radial dendrogram visualization (branch lengths not scaled)
along with some helper methods for building angled-branch trees.
Copyright (c) 2013, Ken-ichi Ueda
All rights reserved.
@olabi
olabi / .block
Created July 12, 2018 06:18 — forked from mbostock/.block
Improved Circle Packing
license: gpl-3.0