Skip to content

Instantly share code, notes, and snippets.

View v0lta's full-sized avatar

Moritz Wolter v0lta

  • High-Performance Computing and Analytics Lab, Bonn University
  • Bonn
  • 10:33 (UTC +01:00)
View GitHub Profile
@willwhitney
willwhitney / tree_stack.py
Last active July 7, 2024 21:37
utils for stacking and unstacking jax pytrees to deal with vmap
import numpy as np
from jax import numpy as jnp
from jax.lib import pytree
def tree_stack(trees):
"""Takes a list of trees and stacks every corresponding leaf.
For example, given two trees ((a, b), c) and ((a', b'), c'), returns
((stack(a, a'), stack(b, b')), stack(c, c')).
@rszeto
rszeto / *pycharm-setup-2020.3.2.md
Last active October 26, 2024 12:55
Setting up PyCharm project with remote interpreter

Setting up PyCharm project with remote interpreter

Setting up a remote interpreter on PyCharm is awfully unintuitive. I've pared it down to what I think is the minimal number of steps, and leaves the fewest number of deployment configurations and Python interpreters lying around. This is designed for my specific configuration (specifically PyTorch); adapt as needed.

Configuring default project (only do after installing PyCharm for the first time):

  1. (Optional) Add virtual environment path to excluded files
    1. From Welcome Page, go to Configure > Settings > Build, Execution, Deployment > Deployment > Options
    2. Add virtualenv path. For example, if you always have the project's virtualenv in .env, add ";.env" to the "Exclude items by name" field
@m14t
m14t / fix_github_https_repo.sh
Created July 5, 2012 21:57
Convert HTTPS github clones to use SSH
#/bin/bash
#-- Script to automate https://help.github.com/articles/why-is-git-always-asking-for-my-password
REPO_URL=`git remote -v | grep -m1 '^origin' | sed -Ene's#.*(https://[^[:space:]]*).*#\1#p'`
if [ -z "$REPO_URL" ]; then
echo "-- ERROR: Could not identify Repo url."
echo " It is possible this repo is already using SSH instead of HTTPS."
exit
fi