applied-ai-018 commited on
Commit
0078116
·
verified ·
1 Parent(s): c6d3cdb

Add files using upload-large-folder tool

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. ckpts/universal/global_step60/zero/12.mlp.dense_h_to_4h.weight/exp_avg.pt +3 -0
  2. ckpts/universal/global_step60/zero/12.mlp.dense_h_to_4h.weight/exp_avg_sq.pt +3 -0
  3. ckpts/universal/global_step60/zero/12.mlp.dense_h_to_4h.weight/fp32.pt +3 -0
  4. ckpts/universal/global_step60/zero/14.mlp.dense_h_to_4h_swiglu.weight/exp_avg.pt +3 -0
  5. ckpts/universal/global_step60/zero/16.attention.dense.weight/exp_avg.pt +3 -0
  6. ckpts/universal/global_step60/zero/16.attention.dense.weight/exp_avg_sq.pt +3 -0
  7. ckpts/universal/global_step60/zero/16.attention.dense.weight/fp32.pt +3 -0
  8. ckpts/universal/global_step60/zero/17.post_attention_layernorm.weight/exp_avg.pt +3 -0
  9. ckpts/universal/global_step60/zero/17.post_attention_layernorm.weight/exp_avg_sq.pt +3 -0
  10. venv/lib/python3.10/site-packages/numpy/f2py/tests/__pycache__/test_common.cpython-310.pyc +0 -0
  11. venv/lib/python3.10/site-packages/numpy/f2py/tests/__pycache__/test_return_logical.cpython-310.pyc +0 -0
  12. venv/lib/python3.10/site-packages/numpy/f2py/tests/src/abstract_interface/foo.f90 +34 -0
  13. venv/lib/python3.10/site-packages/numpy/f2py/tests/src/abstract_interface/gh18403_mod.f90 +6 -0
  14. venv/lib/python3.10/site-packages/numpy/f2py/tests/src/array_from_pyobj/wrapmodule.c +230 -0
  15. venv/lib/python3.10/site-packages/numpy/f2py/tests/src/assumed_shape/.f2py_f2cmap +1 -0
  16. venv/lib/python3.10/site-packages/numpy/f2py/tests/src/assumed_shape/foo_free.f90 +34 -0
  17. venv/lib/python3.10/site-packages/numpy/f2py/tests/src/assumed_shape/foo_mod.f90 +41 -0
  18. venv/lib/python3.10/site-packages/numpy/f2py/tests/src/assumed_shape/foo_use.f90 +19 -0
  19. venv/lib/python3.10/site-packages/numpy/f2py/tests/src/assumed_shape/precision.f90 +4 -0
  20. venv/lib/python3.10/site-packages/numpy/f2py/tests/src/block_docstring/foo.f +6 -0
  21. venv/lib/python3.10/site-packages/numpy/f2py/tests/src/callback/foo.f +62 -0
  22. venv/lib/python3.10/site-packages/numpy/f2py/tests/src/callback/gh17797.f90 +7 -0
  23. venv/lib/python3.10/site-packages/numpy/f2py/tests/src/callback/gh18335.f90 +17 -0
  24. venv/lib/python3.10/site-packages/numpy/f2py/tests/src/callback/gh25211.f +10 -0
  25. venv/lib/python3.10/site-packages/numpy/f2py/tests/src/callback/gh25211.pyf +18 -0
  26. venv/lib/python3.10/site-packages/numpy/f2py/tests/src/cli/gh_22819.pyf +6 -0
  27. venv/lib/python3.10/site-packages/numpy/f2py/tests/src/cli/hi77.f +3 -0
  28. venv/lib/python3.10/site-packages/numpy/f2py/tests/src/cli/hiworld.f90 +3 -0
  29. venv/lib/python3.10/site-packages/numpy/f2py/tests/src/common/block.f +11 -0
  30. venv/lib/python3.10/site-packages/numpy/f2py/tests/src/common/gh19161.f90 +10 -0
  31. venv/lib/python3.10/site-packages/numpy/f2py/tests/src/crackfortran/accesstype.f90 +13 -0
  32. venv/lib/python3.10/site-packages/numpy/f2py/tests/src/crackfortran/data_common.f +8 -0
  33. venv/lib/python3.10/site-packages/numpy/f2py/tests/src/crackfortran/data_multiplier.f +5 -0
  34. venv/lib/python3.10/site-packages/numpy/f2py/tests/src/crackfortran/data_stmts.f90 +20 -0
  35. venv/lib/python3.10/site-packages/numpy/f2py/tests/src/crackfortran/data_with_comments.f +8 -0
  36. venv/lib/python3.10/site-packages/numpy/f2py/tests/src/crackfortran/foo_deps.f90 +6 -0
  37. venv/lib/python3.10/site-packages/numpy/f2py/tests/src/crackfortran/gh15035.f +16 -0
  38. venv/lib/python3.10/site-packages/numpy/f2py/tests/src/crackfortran/gh17859.f +12 -0
  39. venv/lib/python3.10/site-packages/numpy/f2py/tests/src/crackfortran/gh22648.pyf +7 -0
  40. venv/lib/python3.10/site-packages/numpy/f2py/tests/src/crackfortran/gh23533.f +5 -0
  41. venv/lib/python3.10/site-packages/numpy/f2py/tests/src/crackfortran/gh23598.f90 +4 -0
  42. venv/lib/python3.10/site-packages/numpy/f2py/tests/src/crackfortran/gh23598Warn.f90 +11 -0
  43. venv/lib/python3.10/site-packages/numpy/f2py/tests/src/crackfortran/gh23879.f90 +20 -0
  44. venv/lib/python3.10/site-packages/numpy/f2py/tests/src/crackfortran/gh2848.f90 +13 -0
  45. venv/lib/python3.10/site-packages/numpy/f2py/tests/src/crackfortran/operators.f90 +49 -0
  46. venv/lib/python3.10/site-packages/numpy/f2py/tests/src/crackfortran/privatemod.f90 +11 -0
  47. venv/lib/python3.10/site-packages/numpy/f2py/tests/src/crackfortran/publicmod.f90 +10 -0
  48. venv/lib/python3.10/site-packages/numpy/f2py/tests/src/crackfortran/pubprivmod.f90 +10 -0
  49. venv/lib/python3.10/site-packages/numpy/f2py/tests/src/crackfortran/unicode_comment.f90 +4 -0
  50. venv/lib/python3.10/site-packages/numpy/f2py/tests/src/f2cmap/.f2py_f2cmap +1 -0
ckpts/universal/global_step60/zero/12.mlp.dense_h_to_4h.weight/exp_avg.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2a80b97e1d60b58f45d90c9f5826e7aa8ae6615b9908ac945142cad3e6a9429a
3
+ size 33555612
ckpts/universal/global_step60/zero/12.mlp.dense_h_to_4h.weight/exp_avg_sq.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e3ca5922d2d2ae38246b1df1de489ae9b0132d3bb642662709d1f33da7f379e0
3
+ size 33555627
ckpts/universal/global_step60/zero/12.mlp.dense_h_to_4h.weight/fp32.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b3e066f73474bb23821659cb01182dc7a2856469f6d4a48ae32f5037b0138dc7
3
+ size 33555533
ckpts/universal/global_step60/zero/14.mlp.dense_h_to_4h_swiglu.weight/exp_avg.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3d10afb9e3d678a1ba16cc82d0d7ec5da8899b1a934fb0e05afff84778432744
3
+ size 33555612
ckpts/universal/global_step60/zero/16.attention.dense.weight/exp_avg.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:485dc6aa53735aede3d7361bf456fcdb77907a4dc8d603263c0cc9838921675b
3
+ size 16778396
ckpts/universal/global_step60/zero/16.attention.dense.weight/exp_avg_sq.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8e48d587dfd9511cc511d0995003ba3f785c45f4a6bf71b28809ab3fb44a12b4
3
+ size 16778411
ckpts/universal/global_step60/zero/16.attention.dense.weight/fp32.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0c8961acfb9e9267b7458f15b415d15639de782570a4d67d1bf3bcf9c669573f
3
+ size 16778317
ckpts/universal/global_step60/zero/17.post_attention_layernorm.weight/exp_avg.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:49fcd3ebed7dbe5b5d6747331cb28e638fb11591c36c9d76c86c39eb3417fe99
3
+ size 9372
ckpts/universal/global_step60/zero/17.post_attention_layernorm.weight/exp_avg_sq.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:391e815ca19eb819096924287c01699beac54bf70abf4122beeb651ab311c0d5
3
+ size 9387
venv/lib/python3.10/site-packages/numpy/f2py/tests/__pycache__/test_common.cpython-310.pyc ADDED
Binary file (1.4 kB). View file
 
venv/lib/python3.10/site-packages/numpy/f2py/tests/__pycache__/test_return_logical.cpython-310.pyc ADDED
Binary file (2.42 kB). View file
 
venv/lib/python3.10/site-packages/numpy/f2py/tests/src/abstract_interface/foo.f90 ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ module ops_module
2
+
3
+ abstract interface
4
+ subroutine op(x, y, z)
5
+ integer, intent(in) :: x, y
6
+ integer, intent(out) :: z
7
+ end subroutine
8
+ end interface
9
+
10
+ contains
11
+
12
+ subroutine foo(x, y, r1, r2)
13
+ integer, intent(in) :: x, y
14
+ integer, intent(out) :: r1, r2
15
+ procedure (op) add1, add2
16
+ procedure (op), pointer::p
17
+ p=>add1
18
+ call p(x, y, r1)
19
+ p=>add2
20
+ call p(x, y, r2)
21
+ end subroutine
22
+ end module
23
+
24
+ subroutine add1(x, y, z)
25
+ integer, intent(in) :: x, y
26
+ integer, intent(out) :: z
27
+ z = x + y
28
+ end subroutine
29
+
30
+ subroutine add2(x, y, z)
31
+ integer, intent(in) :: x, y
32
+ integer, intent(out) :: z
33
+ z = x + 2 * y
34
+ end subroutine
venv/lib/python3.10/site-packages/numpy/f2py/tests/src/abstract_interface/gh18403_mod.f90 ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ module test
2
+ abstract interface
3
+ subroutine foo()
4
+ end subroutine
5
+ end interface
6
+ end module test
venv/lib/python3.10/site-packages/numpy/f2py/tests/src/array_from_pyobj/wrapmodule.c ADDED
@@ -0,0 +1,230 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * This file was auto-generated with f2py (version:2_1330) and hand edited by
3
+ * Pearu for testing purposes. Do not edit this file unless you know what you
4
+ * are doing!!!
5
+ */
6
+
7
+ #ifdef __cplusplus
8
+ extern "C" {
9
+ #endif
10
+
11
+ /*********************** See f2py2e/cfuncs.py: includes ***********************/
12
+
13
+ #define PY_SSIZE_T_CLEAN
14
+ #include <Python.h>
15
+ #include "fortranobject.h"
16
+ #include <math.h>
17
+
18
+ static PyObject *wrap_error;
19
+ static PyObject *wrap_module;
20
+
21
+ /************************************ call ************************************/
22
+ static char doc_f2py_rout_wrap_call[] = "\
23
+ Function signature:\n\
24
+ arr = call(type_num,dims,intent,obj)\n\
25
+ Required arguments:\n"
26
+ " type_num : input int\n"
27
+ " dims : input int-sequence\n"
28
+ " intent : input int\n"
29
+ " obj : input python object\n"
30
+ "Return objects:\n"
31
+ " arr : array";
32
+ static PyObject *f2py_rout_wrap_call(PyObject *capi_self,
33
+ PyObject *capi_args) {
34
+ PyObject * volatile capi_buildvalue = NULL;
35
+ int type_num = 0;
36
+ int elsize = 0;
37
+ npy_intp *dims = NULL;
38
+ PyObject *dims_capi = Py_None;
39
+ int rank = 0;
40
+ int intent = 0;
41
+ PyArrayObject *capi_arr_tmp = NULL;
42
+ PyObject *arr_capi = Py_None;
43
+ int i;
44
+
45
+ if (!PyArg_ParseTuple(capi_args,"iiOiO|:wrap.call",\
46
+ &type_num,&elsize,&dims_capi,&intent,&arr_capi))
47
+ return NULL;
48
+ rank = PySequence_Length(dims_capi);
49
+ dims = malloc(rank*sizeof(npy_intp));
50
+ for (i=0;i<rank;++i) {
51
+ PyObject *tmp;
52
+ tmp = PySequence_GetItem(dims_capi, i);
53
+ if (tmp == NULL) {
54
+ goto fail;
55
+ }
56
+ dims[i] = (npy_intp)PyLong_AsLong(tmp);
57
+ Py_DECREF(tmp);
58
+ if (dims[i] == -1 && PyErr_Occurred()) {
59
+ goto fail;
60
+ }
61
+ }
62
+ capi_arr_tmp = ndarray_from_pyobj(type_num,elsize,dims,rank,intent|F2PY_INTENT_OUT,arr_capi,"wrap.call failed");
63
+ if (capi_arr_tmp == NULL) {
64
+ free(dims);
65
+ return NULL;
66
+ }
67
+ capi_buildvalue = Py_BuildValue("N",capi_arr_tmp);
68
+ free(dims);
69
+ return capi_buildvalue;
70
+
71
+ fail:
72
+ free(dims);
73
+ return NULL;
74
+ }
75
+
76
+ static char doc_f2py_rout_wrap_attrs[] = "\
77
+ Function signature:\n\
78
+ arr = array_attrs(arr)\n\
79
+ Required arguments:\n"
80
+ " arr : input array object\n"
81
+ "Return objects:\n"
82
+ " data : data address in hex\n"
83
+ " nd : int\n"
84
+ " dimensions : tuple\n"
85
+ " strides : tuple\n"
86
+ " base : python object\n"
87
+ " (kind,type,type_num,elsize,alignment) : 4-tuple\n"
88
+ " flags : int\n"
89
+ " itemsize : int\n"
90
+ ;
91
+ static PyObject *f2py_rout_wrap_attrs(PyObject *capi_self,
92
+ PyObject *capi_args) {
93
+ PyObject *arr_capi = Py_None;
94
+ PyArrayObject *arr = NULL;
95
+ PyObject *dimensions = NULL;
96
+ PyObject *strides = NULL;
97
+ char s[100];
98
+ int i;
99
+ memset(s,0,100);
100
+ if (!PyArg_ParseTuple(capi_args,"O!|:wrap.attrs",
101
+ &PyArray_Type,&arr_capi))
102
+ return NULL;
103
+ arr = (PyArrayObject *)arr_capi;
104
+ sprintf(s,"%p",PyArray_DATA(arr));
105
+ dimensions = PyTuple_New(PyArray_NDIM(arr));
106
+ strides = PyTuple_New(PyArray_NDIM(arr));
107
+ for (i=0;i<PyArray_NDIM(arr);++i) {
108
+ PyTuple_SetItem(dimensions,i,PyLong_FromLong(PyArray_DIM(arr,i)));
109
+ PyTuple_SetItem(strides,i,PyLong_FromLong(PyArray_STRIDE(arr,i)));
110
+ }
111
+ return Py_BuildValue("siNNO(cciii)ii",s,PyArray_NDIM(arr),
112
+ dimensions,strides,
113
+ (PyArray_BASE(arr)==NULL?Py_None:PyArray_BASE(arr)),
114
+ PyArray_DESCR(arr)->kind,
115
+ PyArray_DESCR(arr)->type,
116
+ PyArray_TYPE(arr),
117
+ PyArray_ITEMSIZE(arr),
118
+ PyArray_DESCR(arr)->alignment,
119
+ PyArray_FLAGS(arr),
120
+ PyArray_ITEMSIZE(arr));
121
+ }
122
+
123
+ static PyMethodDef f2py_module_methods[] = {
124
+
125
+ {"call",f2py_rout_wrap_call,METH_VARARGS,doc_f2py_rout_wrap_call},
126
+ {"array_attrs",f2py_rout_wrap_attrs,METH_VARARGS,doc_f2py_rout_wrap_attrs},
127
+ {NULL,NULL}
128
+ };
129
+
130
+ static struct PyModuleDef moduledef = {
131
+ PyModuleDef_HEAD_INIT,
132
+ "test_array_from_pyobj_ext",
133
+ NULL,
134
+ -1,
135
+ f2py_module_methods,
136
+ NULL,
137
+ NULL,
138
+ NULL,
139
+ NULL
140
+ };
141
+
142
+ PyMODINIT_FUNC PyInit_test_array_from_pyobj_ext(void) {
143
+ PyObject *m,*d, *s;
144
+ m = wrap_module = PyModule_Create(&moduledef);
145
+ Py_SET_TYPE(&PyFortran_Type, &PyType_Type);
146
+ import_array();
147
+ if (PyErr_Occurred())
148
+ Py_FatalError("can't initialize module wrap (failed to import numpy)");
149
+ d = PyModule_GetDict(m);
150
+ s = PyUnicode_FromString("This module 'wrap' is auto-generated with f2py (version:2_1330).\nFunctions:\n"
151
+ " arr = call(type_num,dims,intent,obj)\n"
152
+ ".");
153
+ PyDict_SetItemString(d, "__doc__", s);
154
+ wrap_error = PyErr_NewException ("wrap.error", NULL, NULL);
155
+ Py_DECREF(s);
156
+
157
+ #define ADDCONST(NAME, CONST) \
158
+ s = PyLong_FromLong(CONST); \
159
+ PyDict_SetItemString(d, NAME, s); \
160
+ Py_DECREF(s)
161
+
162
+ ADDCONST("F2PY_INTENT_IN", F2PY_INTENT_IN);
163
+ ADDCONST("F2PY_INTENT_INOUT", F2PY_INTENT_INOUT);
164
+ ADDCONST("F2PY_INTENT_OUT", F2PY_INTENT_OUT);
165
+ ADDCONST("F2PY_INTENT_HIDE", F2PY_INTENT_HIDE);
166
+ ADDCONST("F2PY_INTENT_CACHE", F2PY_INTENT_CACHE);
167
+ ADDCONST("F2PY_INTENT_COPY", F2PY_INTENT_COPY);
168
+ ADDCONST("F2PY_INTENT_C", F2PY_INTENT_C);
169
+ ADDCONST("F2PY_OPTIONAL", F2PY_OPTIONAL);
170
+ ADDCONST("F2PY_INTENT_INPLACE", F2PY_INTENT_INPLACE);
171
+ ADDCONST("NPY_BOOL", NPY_BOOL);
172
+ ADDCONST("NPY_BYTE", NPY_BYTE);
173
+ ADDCONST("NPY_UBYTE", NPY_UBYTE);
174
+ ADDCONST("NPY_SHORT", NPY_SHORT);
175
+ ADDCONST("NPY_USHORT", NPY_USHORT);
176
+ ADDCONST("NPY_INT", NPY_INT);
177
+ ADDCONST("NPY_UINT", NPY_UINT);
178
+ ADDCONST("NPY_INTP", NPY_INTP);
179
+ ADDCONST("NPY_UINTP", NPY_UINTP);
180
+ ADDCONST("NPY_LONG", NPY_LONG);
181
+ ADDCONST("NPY_ULONG", NPY_ULONG);
182
+ ADDCONST("NPY_LONGLONG", NPY_LONGLONG);
183
+ ADDCONST("NPY_ULONGLONG", NPY_ULONGLONG);
184
+ ADDCONST("NPY_FLOAT", NPY_FLOAT);
185
+ ADDCONST("NPY_DOUBLE", NPY_DOUBLE);
186
+ ADDCONST("NPY_LONGDOUBLE", NPY_LONGDOUBLE);
187
+ ADDCONST("NPY_CFLOAT", NPY_CFLOAT);
188
+ ADDCONST("NPY_CDOUBLE", NPY_CDOUBLE);
189
+ ADDCONST("NPY_CLONGDOUBLE", NPY_CLONGDOUBLE);
190
+ ADDCONST("NPY_OBJECT", NPY_OBJECT);
191
+ ADDCONST("NPY_STRING", NPY_STRING);
192
+ ADDCONST("NPY_UNICODE", NPY_UNICODE);
193
+ ADDCONST("NPY_VOID", NPY_VOID);
194
+ ADDCONST("NPY_NTYPES", NPY_NTYPES);
195
+ ADDCONST("NPY_NOTYPE", NPY_NOTYPE);
196
+ ADDCONST("NPY_USERDEF", NPY_USERDEF);
197
+
198
+ ADDCONST("CONTIGUOUS", NPY_ARRAY_C_CONTIGUOUS);
199
+ ADDCONST("FORTRAN", NPY_ARRAY_F_CONTIGUOUS);
200
+ ADDCONST("OWNDATA", NPY_ARRAY_OWNDATA);
201
+ ADDCONST("FORCECAST", NPY_ARRAY_FORCECAST);
202
+ ADDCONST("ENSURECOPY", NPY_ARRAY_ENSURECOPY);
203
+ ADDCONST("ENSUREARRAY", NPY_ARRAY_ENSUREARRAY);
204
+ ADDCONST("ALIGNED", NPY_ARRAY_ALIGNED);
205
+ ADDCONST("WRITEABLE", NPY_ARRAY_WRITEABLE);
206
+ ADDCONST("WRITEBACKIFCOPY", NPY_ARRAY_WRITEBACKIFCOPY);
207
+
208
+ ADDCONST("BEHAVED", NPY_ARRAY_BEHAVED);
209
+ ADDCONST("BEHAVED_NS", NPY_ARRAY_BEHAVED_NS);
210
+ ADDCONST("CARRAY", NPY_ARRAY_CARRAY);
211
+ ADDCONST("FARRAY", NPY_ARRAY_FARRAY);
212
+ ADDCONST("CARRAY_RO", NPY_ARRAY_CARRAY_RO);
213
+ ADDCONST("FARRAY_RO", NPY_ARRAY_FARRAY_RO);
214
+ ADDCONST("DEFAULT", NPY_ARRAY_DEFAULT);
215
+ ADDCONST("UPDATE_ALL", NPY_ARRAY_UPDATE_ALL);
216
+
217
+ #undef ADDCONST(
218
+
219
+ if (PyErr_Occurred())
220
+ Py_FatalError("can't initialize module wrap");
221
+
222
+ #ifdef F2PY_REPORT_ATEXIT
223
+ on_exit(f2py_report_on_exit,(void*)"array_from_pyobj.wrap.call");
224
+ #endif
225
+
226
+ return m;
227
+ }
228
+ #ifdef __cplusplus
229
+ }
230
+ #endif
venv/lib/python3.10/site-packages/numpy/f2py/tests/src/assumed_shape/.f2py_f2cmap ADDED
@@ -0,0 +1 @@
 
 
1
+ dict(real=dict(rk="double"))
venv/lib/python3.10/site-packages/numpy/f2py/tests/src/assumed_shape/foo_free.f90 ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ subroutine sum(x, res)
3
+ implicit none
4
+ real, intent(in) :: x(:)
5
+ real, intent(out) :: res
6
+
7
+ integer :: i
8
+
9
+ !print *, "sum: size(x) = ", size(x)
10
+
11
+ res = 0.0
12
+
13
+ do i = 1, size(x)
14
+ res = res + x(i)
15
+ enddo
16
+
17
+ end subroutine sum
18
+
19
+ function fsum(x) result (res)
20
+ implicit none
21
+ real, intent(in) :: x(:)
22
+ real :: res
23
+
24
+ integer :: i
25
+
26
+ !print *, "fsum: size(x) = ", size(x)
27
+
28
+ res = 0.0
29
+
30
+ do i = 1, size(x)
31
+ res = res + x(i)
32
+ enddo
33
+
34
+ end function fsum
venv/lib/python3.10/site-packages/numpy/f2py/tests/src/assumed_shape/foo_mod.f90 ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ module mod
3
+
4
+ contains
5
+
6
+ subroutine sum(x, res)
7
+ implicit none
8
+ real, intent(in) :: x(:)
9
+ real, intent(out) :: res
10
+
11
+ integer :: i
12
+
13
+ !print *, "sum: size(x) = ", size(x)
14
+
15
+ res = 0.0
16
+
17
+ do i = 1, size(x)
18
+ res = res + x(i)
19
+ enddo
20
+
21
+ end subroutine sum
22
+
23
+ function fsum(x) result (res)
24
+ implicit none
25
+ real, intent(in) :: x(:)
26
+ real :: res
27
+
28
+ integer :: i
29
+
30
+ !print *, "fsum: size(x) = ", size(x)
31
+
32
+ res = 0.0
33
+
34
+ do i = 1, size(x)
35
+ res = res + x(i)
36
+ enddo
37
+
38
+ end function fsum
39
+
40
+
41
+ end module mod
venv/lib/python3.10/site-packages/numpy/f2py/tests/src/assumed_shape/foo_use.f90 ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ subroutine sum_with_use(x, res)
2
+ use precision
3
+
4
+ implicit none
5
+
6
+ real(kind=rk), intent(in) :: x(:)
7
+ real(kind=rk), intent(out) :: res
8
+
9
+ integer :: i
10
+
11
+ !print *, "size(x) = ", size(x)
12
+
13
+ res = 0.0
14
+
15
+ do i = 1, size(x)
16
+ res = res + x(i)
17
+ enddo
18
+
19
+ end subroutine
venv/lib/python3.10/site-packages/numpy/f2py/tests/src/assumed_shape/precision.f90 ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ module precision
2
+ integer, parameter :: rk = selected_real_kind(8)
3
+ integer, parameter :: ik = selected_real_kind(4)
4
+ end module
venv/lib/python3.10/site-packages/numpy/f2py/tests/src/block_docstring/foo.f ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ SUBROUTINE FOO()
2
+ INTEGER BAR(2, 3)
3
+
4
+ COMMON /BLOCK/ BAR
5
+ RETURN
6
+ END
venv/lib/python3.10/site-packages/numpy/f2py/tests/src/callback/foo.f ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ subroutine t(fun,a)
2
+ integer a
3
+ cf2py intent(out) a
4
+ external fun
5
+ call fun(a)
6
+ end
7
+
8
+ subroutine func(a)
9
+ cf2py intent(in,out) a
10
+ integer a
11
+ a = a + 11
12
+ end
13
+
14
+ subroutine func0(a)
15
+ cf2py intent(out) a
16
+ integer a
17
+ a = 11
18
+ end
19
+
20
+ subroutine t2(a)
21
+ cf2py intent(callback) fun
22
+ integer a
23
+ cf2py intent(out) a
24
+ external fun
25
+ call fun(a)
26
+ end
27
+
28
+ subroutine string_callback(callback, a)
29
+ external callback
30
+ double precision callback
31
+ double precision a
32
+ character*1 r
33
+ cf2py intent(out) a
34
+ r = 'r'
35
+ a = callback(r)
36
+ end
37
+
38
+ subroutine string_callback_array(callback, cu, lencu, a)
39
+ external callback
40
+ integer callback
41
+ integer lencu
42
+ character*8 cu(lencu)
43
+ integer a
44
+ cf2py intent(out) a
45
+
46
+ a = callback(cu, lencu)
47
+ end
48
+
49
+ subroutine hidden_callback(a, r)
50
+ external global_f
51
+ cf2py intent(callback, hide) global_f
52
+ integer a, r, global_f
53
+ cf2py intent(out) r
54
+ r = global_f(a)
55
+ end
56
+
57
+ subroutine hidden_callback2(a, r)
58
+ external global_f
59
+ integer a, r, global_f
60
+ cf2py intent(out) r
61
+ r = global_f(a)
62
+ end
venv/lib/python3.10/site-packages/numpy/f2py/tests/src/callback/gh17797.f90 ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ function gh17797(f, y) result(r)
2
+ external f
3
+ integer(8) :: r, f
4
+ integer(8), dimension(:) :: y
5
+ r = f(0)
6
+ r = r + sum(y)
7
+ end function gh17797
venv/lib/python3.10/site-packages/numpy/f2py/tests/src/callback/gh18335.f90 ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ! When gh18335_workaround is defined as an extension,
2
+ ! the issue cannot be reproduced.
3
+ !subroutine gh18335_workaround(f, y)
4
+ ! implicit none
5
+ ! external f
6
+ ! integer(kind=1) :: y(1)
7
+ ! call f(y)
8
+ !end subroutine gh18335_workaround
9
+
10
+ function gh18335(f) result (r)
11
+ implicit none
12
+ external f
13
+ integer(kind=1) :: y(1), r
14
+ y(1) = 123
15
+ call f(y)
16
+ r = y(1)
17
+ end function gh18335
venv/lib/python3.10/site-packages/numpy/f2py/tests/src/callback/gh25211.f ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ SUBROUTINE FOO(FUN,R)
2
+ EXTERNAL FUN
3
+ INTEGER I
4
+ REAL*8 R, FUN
5
+ Cf2py intent(out) r
6
+ R = 0D0
7
+ DO I=-5,5
8
+ R = R + FUN(I)
9
+ ENDDO
10
+ END
venv/lib/python3.10/site-packages/numpy/f2py/tests/src/callback/gh25211.pyf ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ python module __user__routines
2
+ interface
3
+ function fun(i) result (r)
4
+ integer :: i
5
+ real*8 :: r
6
+ end function fun
7
+ end interface
8
+ end python module __user__routines
9
+
10
+ python module callback2
11
+ interface
12
+ subroutine foo(f,r)
13
+ use __user__routines, f=>fun
14
+ external f
15
+ real*8 intent(out) :: r
16
+ end subroutine foo
17
+ end interface
18
+ end python module callback2
venv/lib/python3.10/site-packages/numpy/f2py/tests/src/cli/gh_22819.pyf ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ python module test_22819
2
+ interface
3
+ subroutine hello()
4
+ end subroutine hello
5
+ end interface
6
+ end python module test_22819
venv/lib/python3.10/site-packages/numpy/f2py/tests/src/cli/hi77.f ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ SUBROUTINE HI
2
+ PRINT*, "HELLO WORLD"
3
+ END SUBROUTINE
venv/lib/python3.10/site-packages/numpy/f2py/tests/src/cli/hiworld.f90 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ function hi()
2
+ print*, "Hello World"
3
+ end function
venv/lib/python3.10/site-packages/numpy/f2py/tests/src/common/block.f ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ SUBROUTINE INITCB
2
+ DOUBLE PRECISION LONG
3
+ CHARACTER STRING
4
+ INTEGER OK
5
+
6
+ COMMON /BLOCK/ LONG, STRING, OK
7
+ LONG = 1.0
8
+ STRING = '2'
9
+ OK = 3
10
+ RETURN
11
+ END
venv/lib/python3.10/site-packages/numpy/f2py/tests/src/common/gh19161.f90 ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ module typedefmod
2
+ use iso_fortran_env, only: real32
3
+ end module typedefmod
4
+
5
+ module data
6
+ use typedefmod, only: real32
7
+ implicit none
8
+ real(kind=real32) :: x
9
+ common/test/x
10
+ end module data
venv/lib/python3.10/site-packages/numpy/f2py/tests/src/crackfortran/accesstype.f90 ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ module foo
2
+ public
3
+ type, private, bind(c) :: a
4
+ integer :: i
5
+ end type a
6
+ type, bind(c) :: b_
7
+ integer :: j
8
+ end type b_
9
+ public :: b_
10
+ type :: c
11
+ integer :: k
12
+ end type c
13
+ end module foo
venv/lib/python3.10/site-packages/numpy/f2py/tests/src/crackfortran/data_common.f ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ BLOCK DATA PARAM_INI
2
+ COMMON /MYCOM/ MYDATA
3
+ DATA MYDATA /0/
4
+ END
5
+ SUBROUTINE SUB1
6
+ COMMON /MYCOM/ MYDATA
7
+ MYDATA = MYDATA + 1
8
+ END
venv/lib/python3.10/site-packages/numpy/f2py/tests/src/crackfortran/data_multiplier.f ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ BLOCK DATA MYBLK
2
+ IMPLICIT DOUBLE PRECISION (A-H,O-Z)
3
+ COMMON /MYCOM/ IVAR1, IVAR2, IVAR3, IVAR4, EVAR5
4
+ DATA IVAR1, IVAR2, IVAR3, IVAR4, EVAR5 /2*3,2*2,0.0D0/
5
+ END
venv/lib/python3.10/site-packages/numpy/f2py/tests/src/crackfortran/data_stmts.f90 ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ! gh-23276
2
+ module cmplxdat
3
+ implicit none
4
+ integer :: i, j
5
+ real :: x, y
6
+ real, dimension(2) :: z
7
+ real(kind=8) :: pi
8
+ complex(kind=8), target :: medium_ref_index
9
+ complex(kind=8), target :: ref_index_one, ref_index_two
10
+ complex(kind=8), dimension(2) :: my_array
11
+ real(kind=8), dimension(3) :: my_real_array = (/1.0d0, 2.0d0, 3.0d0/)
12
+
13
+ data i, j / 2, 3 /
14
+ data x, y / 1.5, 2.0 /
15
+ data z / 3.5, 7.0 /
16
+ data medium_ref_index / (1.d0, 0.d0) /
17
+ data ref_index_one, ref_index_two / (13.0d0, 21.0d0), (-30.0d0, 43.0d0) /
18
+ data my_array / (1.0d0, 2.0d0), (-3.0d0, 4.0d0) /
19
+ data pi / 3.1415926535897932384626433832795028841971693993751058209749445923078164062d0 /
20
+ end module cmplxdat
venv/lib/python3.10/site-packages/numpy/f2py/tests/src/crackfortran/data_with_comments.f ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ BLOCK DATA PARAM_INI
2
+ COMMON /MYCOM/ MYTAB
3
+ INTEGER MYTAB(3)
4
+ DATA MYTAB/
5
+ * 0, ! 1 and more commenty stuff
6
+ * 4, ! 2
7
+ * 0 /
8
+ END
venv/lib/python3.10/site-packages/numpy/f2py/tests/src/crackfortran/foo_deps.f90 ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ module foo
2
+ type bar
3
+ character(len = 4) :: text
4
+ end type bar
5
+ type(bar), parameter :: abar = bar('abar')
6
+ end module foo
venv/lib/python3.10/site-packages/numpy/f2py/tests/src/crackfortran/gh15035.f ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ subroutine subb(k)
2
+ real(8), intent(inout) :: k(:)
3
+ k=k+1
4
+ endsubroutine
5
+
6
+ subroutine subc(w,k)
7
+ real(8), intent(in) :: w(:)
8
+ real(8), intent(out) :: k(size(w))
9
+ k=w+1
10
+ endsubroutine
11
+
12
+ function t0(value)
13
+ character value
14
+ character t0
15
+ t0 = value
16
+ endfunction
venv/lib/python3.10/site-packages/numpy/f2py/tests/src/crackfortran/gh17859.f ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ integer(8) function external_as_statement(fcn)
2
+ implicit none
3
+ external fcn
4
+ integer(8) :: fcn
5
+ external_as_statement = fcn(0)
6
+ end
7
+
8
+ integer(8) function external_as_attribute(fcn)
9
+ implicit none
10
+ integer(8), external :: fcn
11
+ external_as_attribute = fcn(0)
12
+ end
venv/lib/python3.10/site-packages/numpy/f2py/tests/src/crackfortran/gh22648.pyf ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ python module iri16py ! in
2
+ interface ! in :iri16py
3
+ block data ! in :iri16py:iridreg_modified.for
4
+ COMMON /fircom/ eden,tabhe,tabla,tabmo,tabza,tabfl
5
+ end block data
6
+ end interface
7
+ end python module iri16py
venv/lib/python3.10/site-packages/numpy/f2py/tests/src/crackfortran/gh23533.f ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ SUBROUTINE EXAMPLE( )
2
+ IF( .TRUE. ) THEN
3
+ CALL DO_SOMETHING()
4
+ END IF ! ** .TRUE. **
5
+ END
venv/lib/python3.10/site-packages/numpy/f2py/tests/src/crackfortran/gh23598.f90 ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ integer function intproduct(a, b) result(res)
2
+ integer, intent(in) :: a, b
3
+ res = a*b
4
+ end function
venv/lib/python3.10/site-packages/numpy/f2py/tests/src/crackfortran/gh23598Warn.f90 ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ module test_bug
2
+ implicit none
3
+ private
4
+ public :: intproduct
5
+
6
+ contains
7
+ integer function intproduct(a, b) result(res)
8
+ integer, intent(in) :: a, b
9
+ res = a*b
10
+ end function
11
+ end module
venv/lib/python3.10/site-packages/numpy/f2py/tests/src/crackfortran/gh23879.f90 ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ module gh23879
2
+ implicit none
3
+ private
4
+ public :: foo
5
+
6
+ contains
7
+
8
+ subroutine foo(a, b)
9
+ integer, intent(in) :: a
10
+ integer, intent(out) :: b
11
+ b = a
12
+ call bar(b)
13
+ end subroutine
14
+
15
+ subroutine bar(x)
16
+ integer, intent(inout) :: x
17
+ x = 2*x
18
+ end subroutine
19
+
20
+ end module gh23879
venv/lib/python3.10/site-packages/numpy/f2py/tests/src/crackfortran/gh2848.f90 ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ subroutine gh2848( &
2
+ ! first 2 parameters
3
+ par1, par2,&
4
+ ! last 2 parameters
5
+ par3, par4)
6
+
7
+ integer, intent(in) :: par1, par2
8
+ integer, intent(out) :: par3, par4
9
+
10
+ par3 = par1
11
+ par4 = par2
12
+
13
+ end subroutine gh2848
venv/lib/python3.10/site-packages/numpy/f2py/tests/src/crackfortran/operators.f90 ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ module foo
2
+ type bar
3
+ character(len = 32) :: item
4
+ end type bar
5
+ interface operator(.item.)
6
+ module procedure item_int, item_real
7
+ end interface operator(.item.)
8
+ interface operator(==)
9
+ module procedure items_are_equal
10
+ end interface operator(==)
11
+ interface assignment(=)
12
+ module procedure get_int, get_real
13
+ end interface assignment(=)
14
+ contains
15
+ function item_int(val) result(elem)
16
+ integer, intent(in) :: val
17
+ type(bar) :: elem
18
+
19
+ write(elem%item, "(I32)") val
20
+ end function item_int
21
+
22
+ function item_real(val) result(elem)
23
+ real, intent(in) :: val
24
+ type(bar) :: elem
25
+
26
+ write(elem%item, "(1PE32.12)") val
27
+ end function item_real
28
+
29
+ function items_are_equal(val1, val2) result(equal)
30
+ type(bar), intent(in) :: val1, val2
31
+ logical :: equal
32
+
33
+ equal = (val1%item == val2%item)
34
+ end function items_are_equal
35
+
36
+ subroutine get_real(rval, item)
37
+ real, intent(out) :: rval
38
+ type(bar), intent(in) :: item
39
+
40
+ read(item%item, *) rval
41
+ end subroutine get_real
42
+
43
+ subroutine get_int(rval, item)
44
+ integer, intent(out) :: rval
45
+ type(bar), intent(in) :: item
46
+
47
+ read(item%item, *) rval
48
+ end subroutine get_int
49
+ end module foo
venv/lib/python3.10/site-packages/numpy/f2py/tests/src/crackfortran/privatemod.f90 ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ module foo
2
+ private
3
+ integer :: a
4
+ public :: setA
5
+ integer :: b
6
+ contains
7
+ subroutine setA(v)
8
+ integer, intent(in) :: v
9
+ a = v
10
+ end subroutine setA
11
+ end module foo
venv/lib/python3.10/site-packages/numpy/f2py/tests/src/crackfortran/publicmod.f90 ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ module foo
2
+ public
3
+ integer, private :: a
4
+ public :: setA
5
+ contains
6
+ subroutine setA(v)
7
+ integer, intent(in) :: v
8
+ a = v
9
+ end subroutine setA
10
+ end module foo
venv/lib/python3.10/site-packages/numpy/f2py/tests/src/crackfortran/pubprivmod.f90 ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ module foo
2
+ public
3
+ integer, private :: a
4
+ integer :: b
5
+ contains
6
+ subroutine setA(v)
7
+ integer, intent(in) :: v
8
+ a = v
9
+ end subroutine setA
10
+ end module foo
venv/lib/python3.10/site-packages/numpy/f2py/tests/src/crackfortran/unicode_comment.f90 ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ subroutine foo(x)
2
+ real(8), intent(in) :: x
3
+ ! Écrit à l'écran la valeur de x
4
+ end subroutine
venv/lib/python3.10/site-packages/numpy/f2py/tests/src/f2cmap/.f2py_f2cmap ADDED
@@ -0,0 +1 @@
 
 
1
+ dict(real=dict(real32='float', real64='double'), integer=dict(int64='long_long'))