Created
August 21, 2018 14:36
-
-
Save dhgrs/ca552f5804ddfb4db9669f9189eba76f to your computer and use it in GitHub Desktop.
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 tensorflow as tf | |
from tensorflow.keras.layers import Conv1D | |
class CausalConv(tf.keras.Model): | |
def __init__(self): | |
super(CausalConv, self).__init__() | |
self.conv = Conv1D(filters=16, kernel_size=2, padding='causal') | |
def call(self, x): | |
return self.conv(x) | |
x = tf.zeros([1, 128, 1]) | |
model = CausalConv() | |
y = model(x) | |
print('input shape:', x.shape) | |
print('output shape:', y.shape) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment