Pui Ho Lam
Pui Ho Lam

Reputation: 229

Codegen Error Computed maximum size is not bounded despite assertion

 54            assert(obj.M_1 < 256);
 58            assert(obj.i <= 256);
 59            assert(obj.i > 0);
 62            y = obj.old_x(obj.i:obj.i+obj.M_1,1)'*obj.w;

The codegen report highlighted "obj.i:obj.i+obj.M_1,1" for me but I cannot figure out the problem. Please enlighten me if you have any idea.

Upvotes: 0

Views: 105

Answers (1)

Pui Ho Lam
Pui Ho Lam

Reputation: 229

Adding an extra variable to store the boundary value and assert that variable to some condition solves the problem.

ie.

idx = obj.i+obj.M_1
assert(idx < 512);

Upvotes: 1

Related Questions