Hi,
I am stuck in
w1_unittest.test_next_symbol(next_symbol, NMTAttn)
The unit test for w1_unittest.test_NMTAttn(NMTAttn) has All passed.
In w1_unittest.test_next_symbol(next_symbol, NMTAttn), I am getting the following error which is quite large. I am only posting the initial part.
Can somebody please suggest what is going wrong.
Thanks.
TypeError Traceback (most recent call last)
/opt/conda/lib/python3.7/site-packages/trax/layers/base.py in pure_fn(self, x, weights, state, rng, use_cache)
586 if not self.has_backward:
→ 587 outputs = self.forward(x)
588 s = self.state
/opt/conda/lib/python3.7/site-packages/trax/layers/combinators.py in forward(self, xs)
67 “”“Executes this layer as part of a forward pass through the model.”“”
—> 68 self._validate_forward_inputs(xs)
69 if not self.sublayers: # No-op: outputs = inputs
/opt/conda/lib/python3.7/site-packages/trax/layers/combinators.py in _validate_forward_inputs(self, xs)
129 # TODO(jonni): Include full xs (or shape) in error message?
→ 130 len_xs = 1 if isinstance(xs, jnp.ndarray) else len(xs)
131 if len_xs < self.n_in:
TypeError: object of type ‘int’ has no len()
During handling of the above exception, another exception occurred:
AttributeError Traceback (most recent call last)
/opt/conda/lib/python3.7/site-packages/trax/layers/base.py in pure_fn(self, x, weights, state, rng, use_cache)
586 if not self.has_backward:
→ 587 outputs = self.forward(x)
588 s = self.state
/opt/conda/lib/python3.7/site-packages/trax/layers/combinators.py in forward(self, xs)
87 inputs = inputs_from_stack(stack, layer.n_in)
—> 88 outputs, s = layer.pure_fn(inputs, w, s, rng, use_cache=True)
89 stack = outputs_onto_stack(outputs, stack, layer.n_in)
/opt/conda/lib/python3.7/site-packages/trax/layers/base.py in pure_fn(self, x, weights, state, rng, use_cache)
605 raise LayerError(name, ‘pure_fn’,
→ 606 self._caller, signature(x), trace) from None
607
/opt/conda/lib/python3.7/site-packages/trax/shapes.py in signature(obj)
101 else:
→ 102 return ShapeDtype(obj.shape, obj.dtype)
103
AttributeError: ‘int’ object has no attribute ‘shape’