@@ -47,7 +47,7 @@ class Variable:
4747 # list of nested parameters
4848 contents : List ["Variable" ]
4949
50- def dtype (self , top = True ):
50+ def dtype (self , top : bool = True ) -> np . dtype :
5151 if self .type == VariableType .TUPLE :
5252 elts = [
5353 (str (i + 1 ), param .dtype (top = False ))
@@ -75,7 +75,7 @@ def elt_size(self) -> int:
7575
7676 # total size is elt_size * num_elts
7777
78- def _extract_helper (self , src : np .ndarray , offset : int = 0 ):
78+ def _extract_helper (self , src : np .ndarray , offset : int = 0 ) -> np . ndarray :
7979 start = self .start_idx + offset
8080 end = self .end_idx + offset
8181 if self .type == VariableType .SCALAR :
@@ -98,7 +98,7 @@ def _extract_helper(self, src: np.ndarray, offset: int = 0):
9898 out [i , idx ] = tuple (elt [i ] for elt in elts )
9999 return out .reshape (- 1 , * self .dimensions , order = "F" )
100100
101- def extract_reshape (self , src : np .ndarray , object = True ) -> npt .NDArray [Any ]:
101+ def extract_reshape (self , src : np .ndarray , object : bool = True ) -> npt .NDArray [Any ]:
102102 """
103103 Given an array where the final dimension is the flattened output of a
104104 Stan model, (e.g. one row of a Stan CSV file), extract the variable
0 commit comments