Skip to content

Instantly share code, notes, and snippets.

Avatar

Kyle Daruwalla darsnack

View GitHub Profile
View resnet.jl
struct OptionAIdentity
pool::MaxPool
end
OptionAIdentity(scale::Integer) = OptionAIdentity(MaxPool((scale, scale)))
OptionAIdentity(scale::Tuple{<:Integer, <:Integer}) = OptionAIdentity(MaxPool(scale))
function (op::OptionAIdentity)(x, y)
z = op.pool(y)
npadchannels = size(x, 3) - size(z, 3)
return (npadchannels > 0) ? cat(z, zeros(Float32, size(z, 1), size(z, 2), npadchannels, size(z, 4)); dims = 3) : z
View Error trace
TREE: bitstream.types.SBitstream.sqrt(x)(SimulationId("bitstream.types.SBitstream", "x"))
TRANSFORM: /Users/darsnack/Code/BitSAD/BitBench/IterativeSVD/IterativeSVD.scala
TREE: var z: bitstream.types.SBitstream = bitstream.types.SBitstream.sqrt(x)(SimulationId("bitstream.types.SBitstream", "x"))
TREE: {
var z: bitstream.types.SBitstream = bitstream.types.SBitstream.sqrt(x)(SimulationId("bitstream.types.SBitstream", "x"));
var b: bitstream.types.SBitstream = z.$plus(y)(SimulationId("z", "y"));
b
}
TREE: ({
var z: bitstream.types.SBitstream = bitstream.types.SBitstream.sqrt(x)(SimulationId("bitstream.types.SBitstream", "x"));
@darsnack
darsnack / Macros.scala
Last active Dec 26, 2019
An implementation of a transformer macro
View Macros.scala
package bitstream.macros
import scala.language.experimental.macros
import scala.reflect.macros.blackbox.Context
object Macros {
def simulatable[T](expr: T): Any = macro simulatable_impl[T]
def simulatable_impl[T](c: Context)(expr: c.Expr[T]): c.Expr[T] = {
View keybase.md

Keybase proof

I hereby claim:

  • I am darsnack on github.
  • I am darsnack (https://keybase.io/darsnack) on keybase.
  • I have a public key ASBRyzZcibYpmbL8mv-gKVlTFx9Eq81bDNcE28dvpYDy2Qo

To claim this, I am signing this object:

You can’t perform that action at this time.