brian2/codegen/runtime/numpy_rt/templates/group_get_indices.py_
raw| 1 | {# USES_VARIABLES { N } #} |
| 2 | {% extends 'common_group.py_' %} |
| 3 | |
| 4 | {% block maincode %} |
| 5 | # scalar code |
| 6 | _vectorisation_idx = 1 |
| 7 | {{scalar_code|autoindent}} |
| 8 | |
| 9 | # vector code |
| 10 | _idx = LazyArange(N) |
| 11 | _vectorisation_idx = _idx |
| 12 | |
| 13 | {{vector_code|autoindent}} |
| 14 | |
| 15 | if _cond is True: |
| 16 | _cond = slice(None) |
| 17 | if _cond is False: |
| 18 | _cond = [] |
| 19 | |
| 20 | _return_values = _numpy.array(_idx[_cond]) |
| 21 | {% endblock %} |