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 matplotlib.pyplot as plt | |
import numpy as np | |
def bits_to_unit(d, n): | |
sign = (n >> (d - 1)) & 1 | |
mantissa = n & (2**(d - 1) - 1) | |
return ((-1) ** sign) * (mantissa / (2 ** (d - 1))) | |
def bits_to_float32(n): |
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 torch | |
from diffusers import LCMScheduler | |
from diffusers import DiffusionPipeline, UNet2DConditionModel | |
from huggingface_hub import hf_hub_download | |
from safetensors.torch import load_file | |
class TimestepShiftLCMScheduler(LCMScheduler): | |
def __init__(self, *args, shifted_timestep=250, **kwargs): | |
super().__init__(*args, **kwargs) |
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 datetime | |
import requests | |
import time | |
from tqdm import tqdm | |
class PrintMonitor: | |
# !!! ADD CONFIGURATION !!! # | |
# See https://help.prusa3d.com/guide/wi-fi-and-prusalink-setup-xl-firmware-up-to-4-7-5_419630 |
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
.blob-code-hunk { | |
/* background-color: var(--color-accent-subtle); */ | |
border: 1px solid var(--color-btn-bg); | |
} | |
.blob-num-hunk, .blob-num-expandable { | |
/* background-color: var(--color-accent-muted); */ | |
background-color: var(--color-btn-bg); | |
} |
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 <iostream> | |
#include <iomanip> | |
#include <math.h> | |
#include <curand.h> | |
#include <curand_kernel.h> | |
#define M (N * (N - 1) / 2) | |
#define index (blockDim.x * blockIdx.x + threadIdx.x) | |
#define offset (M * index) | |
#define roll(n) (curand(&rng[index]) % (n)) |
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 os | |
import cProfile | |
from marshmallow import Schema | |
BRANCH = os.popen('git rev-parse --abbrev-ref HEAD').read().strip() | |
values = (1, True, '3') | |
class ImplicitSchema(Schema): | |
class Meta: |
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
INCHES = 25.4; | |
brick_depth = (3 + 5/8) * INCHES; | |
brick_height = (2 + 1/4) * INCHES; | |
brick_length = (7 + 5/8) * INCHES; | |
mortar_gap = (3/8) * INCHES; | |
module Brick() { | |
cube([brick_length, brick_depth, brick_height]); |
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
diff --git a/benchmarks/run.py b/benchmarks/run.py | |
index c1209e9..9f5681f 100644 | |
--- a/benchmarks/run.py | |
+++ b/benchmarks/run.py | |
@@ -15,6 +15,7 @@ from pathlib import Path | |
from statistics import StatisticsError, mean | |
from statistics import stdev as stdev_ | |
+from test_marsha import TestMarsha | |
from test_pydantic import TestPydantic |
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
beforeEach(function () { | |
jasmine.addMatchers({ | |
toHaveBeenResolved: function() { | |
return { | |
compare: function(promise) { | |
promise | |
.thenCatch(function() { | |
expect('promise').toBe('resolved'); | |
}); |
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
beforeEach(function () { | |
jasmine.Matchers = {prototype: {}}; | |
jasmine.Env = {prototype: {}}; | |
require('promise-matchers'); | |
Object.keys(jasmine.Matchers.prototype).forEach(function(key) { | |
var matcher = jasmine.Matchers.prototype[key]; | |
jasmine.Matchers.prototype[key] = function() { | |
return { | |
compare: function(actual, done, expected) { |
NewerOlder