Created
August 19, 2019 13:51
-
-
Save CarpeNecopinum/126d0ac67b79832a975c74441701d8bb to your computer and use it in GitHub Desktop.
Comparing split convolutions
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 CuArrays | |
using Flux: Chain, Conv, gpu | |
batch = rand(256, 256, 1, 16) |> gpu | |
m1 = Chain(Conv((1,3), 1=>1), Conv((3,1), 1=>1)) |> gpu | |
m2 = Conv((3,3), 1=>1) |> gpu | |
using BenchmarkTools: @benchmark | |
@benchmark m1(batch) # ~ 333.1 us | |
@benchmark m2(batch) # ~ 271.8 us | |
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 CuArrays | |
using Flux: Chain, Conv, gpu | |
batch = rand(256, 256, 1, 16) |> gpu | |
m1 = Chain(Conv((1,7), 1=>1), Conv((7,1), 1=>1)) |> gpu | |
m2 = Conv((7,7), 1=>1) |> gpu | |
using BenchmarkTools: @benchmark | |
@benchmark m1(batch) # ~ 383.5us | |
@benchmark m2(batch) # ~ 810.718us | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment