Skip to content

Commit

Permalink
Disallow dlarray in prototype
Browse files Browse the repository at this point in the history
Using `dlarray` in a prototype results in `dlarray` in the output, but without the dimension labels. Reason: `cast(X,'like',Y)` behaves that way for `dlarray` `Y`.

Given that we do not return higher-dimensional data anyway, it is questionable whether there is any reason one would want to allow `dlarray` in prototypes. Not handling them properly means we are better off disabling them altogether.

Without a dependency on Deep Learning Toolbox, we cannot have an automated test point for this change, unfortunately.
  • Loading branch information
ccreutzi committed Nov 5, 2024
1 parent 3dfac40 commit e6199f3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion +llms/+internal/jsonSchemaFromPrototype.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
schema = struct("type","string");
elseif isinteger(prototype)
schema = struct("type","integer");
elseif isnumeric(prototype)
elseif isnumeric(prototype) && ~isa(prototype,'dlarray')
schema = struct("type","number");
elseif islogical(prototype)
schema = struct("type","boolean");
Expand Down

0 comments on commit e6199f3

Please sign in to comment.