When submitting my code, I got this error.
When calling self.pos_encoding(), the parameter(maximum_position_encoding, self.embedding_dim) should be passed through class definition right? Why I got an error message.
TypeError Traceback (most recent call last)
in
1 # UNIT TEST
----> 2 Encoder_test(Encoder)
~/work/W4A1/public_tests.py in Encoder_test(target)
114 x = np.array([[2, 1, 3], [1, 2, 0]])
115
→ 116 encoderq_output = encoderq(x, True, None)
117
118 assert tf.is_tensor(encoderq_output), “Wrong type. Output must be a tensor”
/opt/conda/lib/python3.7/site-packages/tensorflow/python/keras/engine/base_layer.py in call(self, *args, **kwargs)
1010 with autocast_variable.enable_auto_cast_variables(
1011 self._compute_dtype_object):
→ 1012 outputs = call_fn(inputs, *args, **kwargs)
1013
1014 if self._activity_regularizer:
in call(self, x, training, mask)
52 print(“2”, x)
53 # Add the position encoding to embedding
—> 54 x += self.pos_encoding()
55 # Pass the encoded embedding through a dropout layer
56 # use training=training
TypeError: ‘tensorflow.python.framework.ops.EagerTensor’ object is not callable