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
#https://pytorch.org/TensorRT/tutorials/_rendered_examples/dynamo/torch_compile_stable_diffusion.html | |
from diffusers import DiffusionPipeline | |
model_id = "CompVis/stable-diffusion-v1-4" | |
# Instantiate Stable Diffusion Pipeline with FP16 weights (use float32 on CPU) | |
pipe = DiffusionPipeline.from_pretrained( | |
model_id, revision="fp16", torch_dtype=torch.float32 | |
) |
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
valgrind --leak-check=full \ | |
--show-leak-kinds=all \ | |
--track-origins=yes \ | |
--verbose \ | |
--log-file=valgrind-out.txt \ | |
./executable arg1 arg2 |
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
git clone https://github.com/vim-airline/vim-airline ~/.vim/pack/dist/start/vim-airline | |
mkdir -p ~/.vim/pack/tpope/start | |
cd ~/.vim/pack/tpope/start | |
git clone https://tpope.io/vim/fugitive.git | |
vim -u NONE -c "helptags fugitive/doc" -c q | |
mkdir -p ~/.vim/pack/git-plugins/start | |
git clone --depth 1 https://github.com/dense-analysis/ale.git ~/.vim/pack/git-plugins/start/ale |
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 random | |
import math | |
darts = 1000000 | |
darts_in_circle = 1.0 | |
# for each dart | |
for i in range(0, darts): | |
# give it a random continuous location | |
x = random.uniform(0,1) |
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
// mpic++ test.cpp | |
// /home/atmerhannah/openmpi/bin/mpirun --mca osc rdma --hostfile hosts ./a.out | |
#include <stdio.h> | |
#include "mpi.h" | |
int main(int argc, char* argv[]) | |
{ | |
int rank, size; |
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
float s=1944,x[5],y[5],z[5],r[5],j,h,a,b,d,e;int i=33,c,l,f=1;int g(){return f=(f*6478+1)%65346;}m(){x[i]=g()-l;y[i]=(g()-l)/4;r[i]=g()>>4;}main(){char t[1948]=" `MYmtw%FFlj%Jqig~%`jqig~Etsqnsj3stb",*p=t+3,*k="3tjlq9TX";l=s*20;while(i<s)p[i++]='\n'+5;for(i=0;i<5;i++)z[i]=(i?z[i-1]:0)+l/3+!m();while(1){for(c=33;c<s;c++){c+=!((c+1)%81);j=c/s-.5;h=c%81/40.0-1;p[c]=37;for(i=4;i+1;i--)if((b=(a=h*x[i]+j*y[i]+z[i])*a-(d=1+j*j+h*h)*(-r[i]*r[i]+x[i]*x[i]+y[i]*y[i]+z[i]*z[i]))>0){for(e=b;e*e>b*1.01||e*e<b*.99;e-=.5*(e*e-b)/e);p[c]=k[(int)(8*e/d/r[i])];}}for(i=4;i+1;z[i]-=s/2,i--)z[i]=z[i]<0?l*2+!m():z[i];while(i<s)putchar(t[i++]-5);}} |
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> | |
// precondition: array a is sorted | |
int binarySearch(int key, int* a) { | |
int lo = 0; | |
int hi = sizeof(*a) / sizeof(a[0]); | |
while (lo <= hi) { | |
int mid = lo + (hi - lo) / 2; | |
if (key < a[mid]) { hi = mid - 1; } | |
else if (key > a[mid]) { lo = mid + 1; } |
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> | |
// Calculate the square root via successively better approximations | |
int main() | |
{ | |
int N = 10; // iterations | |
double x = 2.0; // derive root of x | |
double arr[N]; | |
arr[0] = 2.0; |
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
void exch(int* a, int x, int y) { | |
int tmp = a[x]; | |
a[x] = a[y]; | |
a[y] = tmp; | |
} | |
int partition(int* a, int lo, int hi) { | |
int i = lo; | |
int j = hi+1; | |
while (true) { |
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 <string> | |
using namespace std; | |
int main() | |
{ | |
int L = 4; | |
int H = 5; | |
string T = "Hello"; |
NewerOlder