This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import jax.numpy as jnp | |
import jax | |
import functools | |
@jax.jit | |
def logadd(x0, x1, x2): | |
# produces nan gradients in backward if -inf log-space zero element is used https://github.com/pytorch/pytorch/issues/31829 | |
#return jax.nn.logsumexp(jnp.stack([x0, x1, x2]), axis=0) | |
# use if -inf log-space zero element is used |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const puppeteer = require('puppeteer'); | |
// Include to be able to export files with node | |
const fs = require('fs'); | |
// This prepares the filenames for the coverage .js files | |
function exportJSFileName(url) { | |
// Remove https:// from the beginning of the string | |
// Remove .js* from the end of the string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Source: https://stackoverflow.com/questions/8199231/how-to-setup-mass-dynamic-virtual-hosts-in-nginx | |
server { | |
listen 80 default_server; | |
listen [::]:80 default_server; | |
# Match any server name with the format [subdomain.[.subdomain...]].domain.tld.dev | |
server_name ~^(?<subdomain>([\w-]+\.)*)?(?<domain>[\w-]+\.[\w-]+)\.dev$; | |
# Map by default to (projects_root_path)/(domain.tld)/www; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foo bar | |
baz | |
qux | |
last line (there may or may not be a trailing newline after this line) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import aiohttp | |
import bs4 | |
import tqdm | |
@asyncio.coroutine | |
def get(*args, **kwargs): | |
response = yield from aiohttp.request('GET', *args, **kwargs) | |
return (yield from response.read_and_close(decode=True)) |