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

Function to_float32

caffe2/python/hypothesis_test_util.py:64–65  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

62
63
64def to_float32(x):
65 return struct.unpack("f", struct.pack("f", float(x)))[0]
66
67
68# "min_satisfying_examples" setting has been deprecated in hypothesis

Callers 1

floatsFunction · 0.85

Calls 2

unpackMethod · 0.45
packMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…