MCPcopy Create free account
hub / github.com/RolnickLab/climart / __init__

Method __init__

climart/utils/callbacks.py:42–51  ·  view source on GitHub ↗
(self,
                 variables: List[str],
                 sizes: Union[int, Sequence[int]]
                 )

Source from the content-addressed store, hash-verified

40
41class PredictionPostProcessCallback:
42 def __init__(self,
43 variables: List[str],
44 sizes: Union[int, Sequence[int]]
45 ):
46 self.variable_to_channel = dict()
47 cur = 0
48 sizes = [sizes for _ in range(len(variables))] if isinstance(sizes, int) else sizes
49 for var, size in zip(variables, sizes):
50 self.variable_to_channel[var] = {'start': cur, 'end': cur + size}
51 cur += size
52
53 def split_vector_by_variable(self,
54 vector: Union[np.ndarray, torch.Tensor]

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected