File: _typedefs.pyx

package info (click to toggle)
scikit-learn 1.4.2%2Bdfsg-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 25,036 kB
  • sloc: python: 201,105; cpp: 5,790; ansic: 854; makefile: 304; sh: 56; javascript: 20
file content (22 lines) | stat: -rw-r--r-- 417 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# _typedefs is a declaration only module
#
# The functions implemented here are for testing purpose only.


import numpy as np


ctypedef fused testing_type_t:
    uint8_t
    uint32_t
    uint64_t
    intp_t
    float32_t
    float64_t
    int32_t
    int64_t


def testing_make_array_from_typed_val(testing_type_t val):
    cdef testing_type_t[:] val_view = <testing_type_t[:1]>&val
    return np.asarray(val_view)