// integer inputs, one per timestep, like embeddings
layer = core.Masking()
func = K.function([layer.input], [layer.get_output_mask()])
input_data = np.array([[[1], [2], [3], [0]],
[[0], [4], [5], [0]]], dtype=np.int32)
// This is the expected output mask, one dimension less
expected = np.array([[1, 1, 1, 0], [0, 1, 1, 0]])
// get mask for this input
output = func([input_data])[0]
self.assertTrue(np.all(output == expected))
def test_non_zero(self):
Test masking with non-zero mask value