Guest User

Untitled

a guest
Mar 22nd, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. def __init__(self, **kwargs):
  2. self.output_dim = K.placeholder(None)
  3. super(SumationLayer, self).__init__(**kwargs)
  4.  
  5. def build(self, input_shape):
  6. # Create a trainable weight variable for this layer.
  7. self.kernel = self.add_weight(name='kernel',
  8. shape=(input_shape[1], self.output_dim),
  9. initializer='uniform',
  10. trainable=True)
  11. super(SumationLayer, self).build(input_shape) # Be sure to call this somewhere!
  12. self.output_dim = (input_shape[0], self.output_dim)
  13. def call(self, x):
  14. return x + self.kernel
  15.  
  16. def compute_output_shape(self, input_shape):
  17. return (input_shape[0], self.output_dim)
  18.  
  19. TypeError: Value passed to parameter 'shape' has DataType float32 not in list of allowed values: int32, int64
Add Comment
Please, Sign In to add comment