This file contains hidden or 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 cupy | |
def axis_replace(shape, axis, value): | |
if axis < 0: | |
axis += len(shape) | |
return shape[:axis] + (value,) + shape[axis+1:] | |
def axis_seq(axis, ndim, value, default): |
This file contains hidden or 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 numpy, cupy | |
import scipy.ndimage as ndi | |
import cupyx.scipy.ndimage as cp_ndi | |
from scipy import LowLevelCallable | |
from numba import cfunc, types, carray | |
##### Root Mean Squared ##### | |
# Actually these are just the mean-squared | |
rms_raw = cupy.RawKernel('''extern "C" __global__ |
This file contains hidden or 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
# pylint: disable=redefined-builtin | |
import cupy | |
# ######## Convolutions and Correlations ########## | |
def correlate(input, weights, output=None, mode='reflect', cval=0.0, origin=0): | |
"""Multi-dimensional correlate. | |
The array is correlated with the given kernel. | |
Args: |
This file contains hidden or 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
#!/usr/bin/env python3 | |
# To install (assuming you have the bash-completions package) | |
# python3 -c 'import gkeep_completions; gkeep_completions.install()' | |
# or if you don't (this doesn't work as well, for example you have to restart your terminal and it edits your .bashrc file) | |
# python3 -c 'import gkeep_completions; gkeep_completions.install_rc()' | |
import os, sys, shlex, subprocess | |
def __get_files(path): |
This file contains hidden or 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
#include <stdio.h> // for FILE, fread, fwrite, feof | |
#include <assert.h> // for assertion checks | |
#include <lznt1.h> // mscomp LZNT1 header | |
#define BUF_SIZE 65536 | |
/* TODO: probably use a return value for error handling or something */ | |
void inflate(FILE *source, FILE *dest) | |
{ |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
""" | |
Simple delay-loaded objects. Essentially this calls a function to generate the object the first time | |
any attribute of the object is accesssed. | |
This supports many object types. Some types it does not support are (at least not fully): | |
* objects with a modified __getattribute__ | |
* objects with __slots__ | |
* objects with __value__ | |
* descriptor objects will not work as descriptors | |
* buffer-able objects will not work with buffer |
This file contains hidden or 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
#include "Flags.hpp" | |
#include <iostream> | |
BOOST_FLAGS_WITH_VALUES(MyFlags, std::uint8_t, A, 1, B, 2, AB, 3, C, 4); | |
BOOST_FLAGS(MyDefaultFlags, AX, BX, CX, DX, EX, FX, GX, HX); | |
namespace MyNS | |
{ | |
BOOST_FLAGS(MyFlags, M, N, O, P, Q); | |
} |
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.