Some of the features mentioned in this document only work on the beta or Dev channel. To change your channel:
- chrome://help in a browser window
- Click Detailed Build Information
- Change Channel
- Select Beta (Or Dev, if you're feeling adventurous)
| ### MATPLOTLIBRC FORMAT | |
| # This is a sample matplotlib configuration file - you can find a copy | |
| # of it on your system in | |
| # site-packages/matplotlib/mpl-data/matplotlibrc. If you edit it | |
| # there, please note that it will be overridden in your next install. | |
| # If you want to keep a permanent local copy that will not be | |
| # over-written, place it in HOME/.matplotlib/matplotlibrc (unix/linux | |
| # like systems) and C:\Documents and Settings\yourname\.matplotlib | |
| # (win32 systems). |
| ## Joshua Ulrich's pivot function | |
| ## This code is alpha and is in development. | |
| ## please test all results to ensure accuracy | |
| pivot <- function(x, rows, cols, FUN=NULL) { | |
| clean <- function(xx, dd) { | |
| cd <- merge(dd,xx,by=0,all=TRUE) | |
| rownames(cd) <- cd$Row.names | |
| cd$Row.names <- NULL | |
| return(cd) |
| # For more explanation and usage examples, see: | |
| # http://www.drhevans.com/blog/posts/331-comparing-large-data-sets-in-python/ | |
| from itertools import imap, izip, count, repeat, tee | |
| import heapq | |
| def full_outer_join(*iterables, **kwargs): | |
| """ | |
| Perform a full outer join on a sequence of sorted iterables, where the | |
| key function supplies the join condition. |
| #!/usr/bin/env python | |
| import sqlite3 | |
| def sumtuples(data, key_index): | |
| cur = sqlite3.connect(':memory:').cursor() | |
| cols = ['i{0}'.format(i) for i, _ in enumerate(data[0])] | |
| schema = 'CREATE TABLE items ({0})'.format(','.join(cols)) | |
| cur.execute(schema) |
| import numpy as np | |
| def regular_multidim_digitize(data, n_bins=3, lbes=None, rbes=None): | |
| """ Build a regular grid and assigns each data point to a cell | |
| Parameters | |
| ---------- | |
| data: (n_points, n_dims) array, | |
| the data that we which to digitize |
This document presents the IR as of October 17th 2018. Future changes like mutability might render parts of this document outdated.
PyTorch uses an SSA-based IR, which is built of multiple entities:
Graph is generally the outermost container for the program representation. At the moment all programs are mostly pure (modulo special operators like prim::Print or prim::PythonOp), but this will change in the future.Blocks, which you can treat as functions. They have a list of inputs and outputs, and a (topologically ordered) list of Nodes. Every Graph has a top-level Block which is (using C lingo) like a main function.Nodes, in turn, represent calls to functions (with possibly multiple arguments and returns).Value - the root Blocks have a list of input values, and every Node takes them as inputs, and returns some more as outputs. Every Value has a Type a