MCPcopy Create free account
hub / github.com/allenai/molmoact2 / max

Method max

experiments/olmo/preprocessing/preprocessor_utils.py:79–90  ·  view source on GitHub ↗
(*other: 'TensorSpec')

Source from the content-addressed store, hash-verified

77
78 @staticmethod
79 def max(*other: 'TensorSpec'):
80 other = [o for o in other if o is not None]
81 if not other:
82 return None
83 rank = len(other[0].shape)
84 dtype = other[0].dtype
85 assert all(rank == len(o.shape) for o in other)
86 assert all(dtype == o.dtype for o in other)
87 return TensorSpec(
88 [max([o.shape[i] for o in other]) for i in range(rank)],
89 dtype
90 )
91
92 def max_dictionaries(*other: Dict[str, 'TensorSpec']):
93 return {k: TensorSpec.max(*(o[k] for o in other if k in o)) for k in get_all_keys(other)}

Callers 15

encode_depth_codesFunction · 0.45
_decode_imageFunction · 0.45
depth_codes_to_rgbFunction · 0.45
collect_validFunction · 0.45
get_absolute_coordinatesFunction · 0.45
example_to_html_dictFunction · 0.45
_apply_augmentationMethod · 0.45
extract_pointsMethod · 0.45
_collateFunction · 0.45
max_dictionariesMethod · 0.45

Calls 1

TensorSpecClass · 0.85

Tested by

no test coverage detected