File: _typedefs.pyx

package info (click to toggle)
scikit-learn 1.7.2%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 25,752 kB
  • sloc: python: 219,120; cpp: 5,790; ansic: 846; makefile: 191; javascript: 110
file content (23 lines) | stat: -rw-r--r-- 428 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
23
# _typedefs is a declaration only module
#
# The functions implemented here are for testing purpose only.


import numpy as np


ctypedef fused testing_type_t:
    float32_t
    float64_t
    int8_t
    int32_t
    int64_t
    intp_t
    uint8_t
    uint32_t
    uint64_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)