MCPcopy Create free account
hub / github.com/numpy/numpy / get_square

Function get_square

benchmarks/benchmarks/common.py:52–61  ·  view source on GitHub ↗
(dtype)

Source from the content-addressed store, hash-verified

50
51@lru_cache(typed=True)
52def get_square(dtype):
53 values = get_values()
54 arr = values.astype(dtype=dtype).reshape((nx, ny))
55
56 # adjust complex ones to have non-degenerated imagery part -- use
57 # original data transposed for that
58 if arr.dtype.kind == 'c':
59 arr += arr.T*1j
60
61 return arr
62
63@lru_cache(typed=True)
64def get_squares():

Callers 2

get_squaresFunction · 0.85
get_square_Function · 0.85

Calls 3

get_valuesFunction · 0.85
reshapeMethod · 0.80
astypeMethod · 0.80

Tested by

no test coverage detected