Skip to content

Instantly share code, notes, and snippets.

View 0x00b1's full-sized avatar
🕶️

Allen Goodman 0x00b1

🕶️
View GitHub Profile
@0x00b1
0x00b1 / segment_sum.py
Last active January 31, 2024 19:34
PyTorch `segment_sum` operator
from typing import Optional
import math
from torch import Tensor
import torch
def segment_sum(input: Tensor, indexes: Tensor, n: Optional[int] = None, **kwargs) -> Tensor:
if indexes.ndim == 1:
indexes = torch.repeat_interleave(indexes, math.prod([*input.shape[1:]])).view(*[indexes.shape[0], *input.shape[1:]])
@0x00b1
0x00b1 / iota.py
Created January 31, 2024 18:17
PyTorch `iota` operator
from torch import Tensor
import torch
def iota(shape: tuple[int, ...], dim: int = 0, **kwargs) -> Tensor:
dimensions = []
for index, _ in enumerate(shape):
if index != dim:
dimension = 1
@0x00b1
0x00b1 / 2020
Last active December 27, 2020 21:25
2020 (MAGIK MARKERS)
6 (PHARAOH OVERLORD)
7 WEAPONS SERIES (HOWIE LEE)
A LATE ANTHOLOGY OF EARLY MUSIC VOL. 1 ANCIENT TO RENAISSANCE (JENNIFER WALSHE)
A NEW DAWN (ACEMOMA)
A PAN-AIR MUSIC (ROLAND KAYN)
ABSCESS TIME (PYRRHON)
ALIEN MODE (PEARSON SOUND)
ALL OR NOTHING (SHOPPING)
ALL THE TIME (JESSY LANZA)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@0x00b1
0x00b1 / 2019
Created December 5, 2019 14:12
6 PARTITAS (HILARY HAHN, ANTÓN GARCÍA ABRIL)
A GOOD TIME (DAVIDO)
ABSOLUTE ZERO (BRUCE HORNSBY)
AFTER ITS OWN DEATH / WALKING IN A SPIRAL TOWARDS THE HOUSE (NIVHEK)
AGORA (FENNESZ)
AKRASIA (DJ SPORTS)
ALL MIRRORS (ANGEL OLSEN)
BASKING IN THE GLOW (OSO OSO)
BECOME DESERT (JOHN LUTHER ADAMS)
C.1300-C.2000 (JEREMY DENK)
import Dexie from 'dexie';
import { Plugin, Uppy, UppyFile } from '@uppy/core';
interface Entry {
id?: number;
data: Blob | File;
}
class Database extends Dexie {
files: Dexie.Table<Entry, number>;
record Node[T]:
a: Node[T]
b: Node[T]
data: T
type Tree[T] ← [Node[T]]
subroutine visit(item: Node[T], f: function (T)):
f(item.data)

Primitive data type

A scalar type represents a single value. Ox has three primitive scalar types:

  • Boolean,
  • Floating-point, and
  • Integer.

Boolean data type

@0x00b1
0x00b1 / 2018
Created December 9, 2018 22:16
(alive) (Mount Eerie)
Another Place (upsammy)
Bad Witch (Nine Inch Nails)
Cocoon Crush (Objekt)
Collapse EP (Aphex Twin)
Compro (Skee Mask)
DAYTONA (Pusha T)
Debiasing EP (Barker)
Double Negative (Low)
Enclave EP (Nazar)