Vk:
- https://github.com/google/filament/blob/main/filament/backend/src/vulkan/VulkanPipelineCache.h
- https://github.com/google/filament/blob/main/filament/backend/src/vulkan/VulkanPipelineCache.cpp
Metal:
import json | |
# Define the input and output file paths | |
input_file = 'fused_model/tokenizer.json' | |
output_file = 'fused_model/repaired_tokenizer.json' | |
# Read the JSON file containing the entire structure | |
with open(input_file, 'r', encoding='utf-8') as f: | |
data = json.load(f) |
#!/usr/bin/env python3 | |
import http.server | |
import socketserver | |
PORT = 8000 | |
Handler = http.server.SimpleHTTPRequestHandler | |
Handler.extensions_map.update({ | |
'.wasm': 'application/wasm', |
template <typename T> | |
bool operator()(T const* const* parameters, T* residuals) const { | |
const T* inputs = parameters[0]; | |
size_t i = 0; | |
for (size_t n = _constraints.size(); i < n; ++i) { | |
T residual(0.0); | |
const Constraint& constraint = _constraints[i]; | |
switch (constraint.type) { | |
case ConstraintType::ArcLineTangent: { | |
const auto& info = constraint.arc_line_tangent; |
zstd is a C library that features very fast decompression (similar to snappy) and dictionary-based compression.
Asking zstd to perform best possible compression is slow, but decompressing the result is still fast.
It also has command tool:
brew install zstd
#!/usr/bin/env python3 | |
from nfft import nfft | |
import matplotlib.pyplot as plt | |
import numpy as np | |
from numpy.fft import fft | |
def gen_values(times: np.ndarray) -> np.ndarray: | |
"Compose three waves." | |
freq = 1 |
Image Quilting can be used to synthesize a large texture from a tiny texture; it was coined in Efros 2001, which introduced the idea of a cutting a minimum cost path through a tile to make the seams less discernable. ("Image Transfer" is also discussed in this paper, which is less interesting to me.)
Wang Tiles were popularized in Cohen 2003. These make it possible to apply image quilting over an infinite region, by baking out a small set of orientable tiles. (They can also be used for generating maze-like structures, which is somewhat orthogonal to the image quilting stuff.)
Wang Tiles can also be used to generate aperioidic tilings of blue noise (or point samples), and they can even be applied in a recursive manner, which allows for infinite zoom; see Kopf 2006, as well as [this excelle
#version 310 es | |
// glslc -std=310es -fshader-stage=vertex piecewise.glsl | |
// spirv-opt -Os a.spv -o b.spv | |
// spirv-cross b.spv | |
layout(binding = 0) uniform FrameUniforms { | |
mat4 clipFromWorldMatrix; | |
} frameUniforms; |
// clock all <button> with aria-label="Display the rich diff" | |
buttons = [].filter.call( | |
document.getElementsByTagName('button'), | |
el => el.getAttribute('aria-label') == "Display the rich diff"); | |
buttons.forEach(el => el.click()) |
* thread #3, name = 'FEngine::loop', stop reason = signal SIGSEGV: invalid address (fault address: 0x7fff00000000) | |
* frame #0: 0x00007ffff2b6f37e libc.so.6`__libc_malloc + 286 | |
frame #1: 0x00007ffff32ac4b9 libvk_swiftshader.so`(anonymous namespace)::alignedMalloc(alignment=8, size=272) at memory.cpp:185:21 | |
frame #2: 0x00007ffff32ac1f8 libvk_swiftshader.so`(anonymous namespace)::DefaultAllocator::allocate(this=0x00007ffff7e22be8, request=0x00007ffff10a7a68) at memory.cpp:210:13 | |
frame #3: 0x00007ffff30d4763 libvk_swiftshader.so`std::shared_ptr<marl::Event::Shared> marl::Allocator::make_shared<marl::Event::Shared, marl::Allocator*&, marl::Event::Mode&, bool&>(this=0x00007ffff7e22be8, args=0x00007ffff10a7ab8, args=0x00007ffff10a7ac7, args=0x00007ffff10a7ac6) at memory.h:227:16 | |
frame #4: 0x00007ffff30d36c7 libvk_swiftshader.so`marl::Event::Event(this=0x0000000002071440, mode=Manual, initialState=false, allocator=0x00007ffff7e22be8) at event.h:187:25 | |
frame #5: 0x00007ffff30d35e3 libvk_swiftshad |