Skip to content

Instantly share code, notes, and snippets.

@jerryzh168
Created November 10, 2018 01:59
Show Gist options
  • Save jerryzh168/c1b457a6054fbbdbf4c39c7aad3b7c78 to your computer and use it in GitHub Desktop.
Save jerryzh168/c1b457a6054fbbdbf4c39c7aad3b7c78 to your computer and use it in GitHub Desktop.
caffe2 conv transpose
from caffe2.python.functional import Functional as F
import numpy as np
x = np.arange(1, 10).reshape([1, 3, 3, 1]).astype(np.float32)
w = np.zeros([1, 3, 3, 1]).astype(np.float32)
b = np.zeros([1]).astype(np.float32)
y = F.ConvTranspose(x, w, b, kernels=[3,3], pads=[0, 0, 0, 0], strides=[1,1], output_shape = [1, 5, 5, 1], order="NHWC")
print(y)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment