This file contains 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 StableDiffusionPipeline | |
access_token = "<access token>" | |
# make sure you're logged in with `huggingface-cli login` | |
pipe = StableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4", revision="fp16", torch_dtype=torch.float16, use_auth_token=access_token) | |
pipe = pipe.to("cuda") |
This file contains 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
Принятие заявок (CFP) на JuliaCon 2022 открыто: https://t.co/T9LrFCVJfH | |
Если вы хотите выступить с докладом или виртуальным постером, провести минисимпозиум, практикум или | |
просто поделиться опытом, то обязательно перейдите по ссылке выше! | |
#JuliaLang #JuliaCon |
This file contains 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
function foo() | |
ts = Task[] | |
begin | |
for i in 1:20 | |
t = @task begin | |
sleep(i/10) | |
println(i) | |
@assert i != 5 | |
end | |
push!(ts, t) |
This file contains 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
using CSV | |
using DataPipes | |
using SplitApplyCombine | |
csv = """ | |
x,y,z | |
1,3,5 | |
1,2,4 | |
2,4,1 | |
""" |
This file contains 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
0.19345484517173928 | |
0.11384864375977188 | |
0.1844963245314597 | |
0.11030110979110863 | |
0.6292936087454175 | |
0.11452167250127743 | |
0.06513420967099504 | |
0.9024443886795332 | |
0.19154452909475705 | |
0.34650274437026796 |
This file contains 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
function f1(v) | |
v1 = deepcopy(v) | |
stats = @timed sort!(v1) | |
return stats.time*1.0e6 | |
end | |
function f2(v) | |
v1 = deepcopy(v) | |
v2 = @views v1[500:1499] | |
stats = @timed sort!(v2) |
This file contains 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
""" | |
This is an implementation of the NBabel N-body problem. | |
See nbabel.org for more information. | |
This is 'naive & native' Julia with type and loop annotations for | |
fastmath and vectorization, because this is really is no effort. | |
Without annotations the code will be as slow as naive Python/IDL. | |
include("nbabel.jl") |
This file contains 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
""" | |
This is an implementation of the NBabel N-body problem. | |
See nbabel.org for more information. | |
This is 'naive & native' Julia with type and loop annotations for | |
fastmath and vectorization, because this is really is no effort. | |
Without annotations the code will be as slow as naive Python/IDL. | |
include("nbabel.jl") |
This file contains 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
""" | |
This is an implementation of the NBabel N-body problem. | |
See nbabel.org for more information. | |
This is 'naive & native' Julia with type and loop annotations for | |
fastmath and vectorization, because this is really is no effort. | |
Without annotations the code will be as slow as naive Python/IDL. | |
include("nbabel.jl") |
This file contains 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
using StableRNGs | |
function validate2(res, n) | |
cnt = 0 | |
for i in res | |
for j in res | |
cnt += (i != j) & (i + j == n) | |
end | |
end | |
cnt == 2 |
NewerOlder