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
| type DeferredState = "pending" | "resolved" | "rejected"; | |
| export class Deferred<T> { | |
| public promise: Promise<T>; | |
| public resolve!: (value: T) => void; | |
| public reject!: (reason?: unknown) => void; | |
| private state: DeferredState = "pending"; | |
| private value?: T; |
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
| # install flashinfer by running: | |
| # pip install flashinfer -i https://flashinfer.ai/whl/cu121/torch2.3/ | |
| import torch | |
| import flashinfer | |
| from math import sqrt, ceil | |
| torch.manual_seed(0) | |
| num_layers = 32 |
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 as np | |
| def count_parameters_tflite(model): | |
| details = model.get_tensor_details() | |
| # Calculate the total number of trainable parameters | |
| total_params = 0 | |
| for detail in details: | |
| shape = detail['shape'] | |
| if 'weight' in detail['name'] or 'bias' in detail['name']: | |
| total_params += np.prod(shape) |
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
| // CC: cc -O3 -Wall -Wextra $(pkg-config --cflags --static SvtAv1Enc) enc.c $(pkg-config --libs --static SvtAv1Enc) | |
| #include <pthread.h> // for pthread_exit, pthread_create, pthread_join | |
| #include <stdbool.h> // for bool, false | |
| #include <stdint.h> // for uint8_t, uint64_t, uint16_t, uint32_t | |
| #include <stdio.h> // for size_t, NULL, fprintf, fputs, fwrite | |
| #include <stdlib.h> // for calloc, free, strtoul | |
| #include "EbSvtAv1.h" // for EbSvtIOFormat, EbBufferHeaderType, EB_E... | |
| #include "EbSvtAv1Enc.h" // for svt_av1_enc_parse_parameter, svt_av1_en... | |
| #include "EbSvtAv1Formats.h" // for EB_EIGHT_BIT, EB_YUV420 |
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
| package main | |
| import ( | |
| "fmt" | |
| "os" | |
| "time" | |
| "github.com/pion/rtcp" | |
| "github.com/pion/webrtc/v2" | |
| "github.com/pion/webrtc/v2/pkg/media" |
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
| Homebrew build logs for mysql on macOS 10.13.5 | |
| Build date: 2018-07-17 11:59:12 |
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 tensorflow as tf | |
| import time | |
| m1 = [] | |
| m2 = [] | |
| result = [] | |
| i = 10 | |
| while i <= 10000: | |
| m1.append(tf.random_uniform(shape = [i, i])) | |
| m2.append(tf.random_uniform(shape = [i, i])) | |
| i *= 10 |
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 tensorflow as tf | |
| tf.logging.set_verbosity(tf.logging.ERROR) | |
| from tensorflow.examples.tutorials.mnist import input_data | |
| from time import time | |
| import sys | |
| mnist = input_data.read_data_sets("MNIST_data/", one_hot=True) | |
| image_size = 28 | |
| x = tf.placeholder(tf.float32, [None, 784]) |
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
| from tensorflow.examples.tutorials.mnist import input_data | |
| import sys | |
| layers = int(sys.argv[1]) | |
| import tensorflow as tf | |
| from time import time | |
| mnist = input_data.read_data_sets("MNIST_data/", one_hot=True) | |
| x = tf.placeholder(tf.float32, [None, 784]) | |
| hiddenLayer = tf.layers.dense(x, 1000, activation = tf.nn.tanh) |