MCPcopy Create free account
hub / github.com/pytorch/pytorch / floats

Function floats

caffe2/python/hypothesis_test_util.py:86–99  ·  view source on GitHub ↗
(*args, **kwargs)

Source from the content-addressed store, hash-verified

84# This wrapper wraps around `st.floats` and
85# sets width parameters to 32 if version is newer than 3.67.0
86def floats(*args, **kwargs):
87
88 width_supported = hypothesis.version.__version_info__ >= (3, 67, 0)
89 if 'width' in kwargs and not width_supported:
90 kwargs.pop('width')
91
92 if 'width' not in kwargs and width_supported:
93 kwargs['width'] = 32
94 if kwargs.get('min_value', None) is not None:
95 kwargs['min_value'] = to_float32(kwargs['min_value'])
96 if kwargs.get('max_value', None) is not None:
97 kwargs['max_value'] = to_float32(kwargs['max_value'])
98
99 return st.floats(*args, **kwargs)
100
101
102hypothesis.settings.register_profile(

Callers 1

elements_of_typeFunction · 0.70

Calls 3

to_float32Function · 0.85
popMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…