Skip to content

Commit d0b8bdf

Browse files
committed
Fix: axis labels are not dimension units shape_spec_to_dims_bio
1 parent bde1be8 commit d0b8bdf

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tensor/shape.ml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1922,12 +1922,13 @@ let shape_spec_to_dims_bio labels =
19221922
let dim_var_env = Hashtbl.create (module String) in
19231923
let f _kind = function
19241924
| Label s when String.contains s '=' -> (
1925-
let label, dim =
1925+
let _label, dim =
19261926
match String.split s ~on:'=' with
19271927
| [ l; d ] -> (l, d)
19281928
| _ -> invalid_arg "shape_spec_to_dims_bio: too many '='"
19291929
in
1930-
try Row.get_dim ~d:(Int.of_string dim) ~label ()
1930+
(* This is not a dimension label i.e. unit! *)
1931+
try Row.get_dim ~d:(Int.of_string dim) ()
19311932
with _ -> invalid_arg "shape_spec_to_dims_bio: int expected after '='")
19321933
| Label name ->
19331934
Var (Hashtbl.find_or_add dim_var_env name ~default:(fun () -> Row.get_var ~name ()))

0 commit comments

Comments
 (0)