Last Update: Octover 10, 2017
Offline Version
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
module Contextual | |
using Core: CodeInfo, MethodTable, MethodInstance, SSAValue, SlotNumber, NewvarNode, ReturnNode, GotoNode, GotoIfNot | |
using Base.Meta: isexpr | |
create_codeinfo(argnames, body; kws...) = create_codeinfo(argnames, nothing, body; kws...) | |
create_codeinfo(mod::Module, argnames, body; kws...) = create_codeinfo(mod, argnames, nothing, body; kws...) | |
create_codeinfo(argnames, spnames, body; kws...) = create_codeinfo(@__MODULE__, argnames, spnames, body; kws...) | |
function create_codeinfo(mod::Module, argnames, spnames, body; inline = false) | |
# argnames: `Vector{Symbol}` representing the variable names, starts with `Symbol("#self#")`. |
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 Flux | |
using CUDA | |
import Optimisers | |
using NNlibCUDA | |
NNlibCUDA.softmaxalgo() = NNlibCUDA.CUDNN_SOFTMAX_ACCURATE | |
CUDA.math_mode!(CUDA.FAST_MATH; precision=:Float16) | |
# similar to Optimisers._grads! but accumulate |
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 Data.List (sortBy) | |
-- This exercise covers the first 6 and the 8th chapters of "Learn You a Haskell for Great Good!" | |
-- Chapter 1 - http://learnyouahaskell.com/introduction | |
-- Chapter 2 - http://learnyouahaskell.com/starting-out | |
-- Chapter 3 - http://learnyouahaskell.com/types-and-typeclasses | |
-- Chapter 4 - http://learnyouahaskell.com/syntax-in-functions | |
-- Chapter 5 - http://learnyouahaskell.com/recursion | |
-- Chapter 6 - http://learnyouahaskell.com/higher-order-functions | |
-- Chapter 8 - http://learnyouahaskell.com/making-our-own-types-and-typeclasses |
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 Data.List (sortBy) | |
-- This exercise covers the first 6 chapters of "Learn You a Haskell for Great Good!" | |
-- Chapter 1 - http://learnyouahaskell.com/introduction | |
-- Chapter 2 - http://learnyouahaskell.com/starting-out | |
-- Chapter 3 - http://learnyouahaskell.com/types-and-typeclasses | |
-- Chapter 4 - http://learnyouahaskell.com/syntax-in-functions | |
-- Chapter 5 - http://learnyouahaskell.com/recursion | |
-- Chapter 6 - http://learnyouahaskell.com/higher-order-functions |
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 Pkg.Artifacts | |
const ARTIFACTS_TOML = joinpath(@__DIR__, "Artifacts.toml") | |
const CLOUDFRONT_DISTRIB_PREFIX = "https://cdn.huggingface.co" | |
const S3_BUCKET_PREFIX = "https://s3.amazonaws.com/models.huggingface.co/bert" | |
const DEFAULT_CONFIG_NAME = "config.json" | |
const DEFAULT_WEIGHT_NAME = "pytorch_model.bin" | |
function register_model_artifact(name; config=DEFAULT_CONFIG_NAME, weight=DEFAULT_WEIGHT_NAME, download_prefix=CLOUDFRONT_DISTRIB_PREFIX) |
freebsd zfs auto backup daemon written in Python3.5 with coroutine
put zbackup
in /usr/local/bin
and rename zbackup.rc
to zbackup
and put it inside /usr/local/etc/rc.d
. And put zbackup.conf
to where your zbackup_config
, which is in rc.conf
, point to. And don't forget zbackup_enable="YES"