Generated by Cython 3.0.11

Yellow lines hint at Python interaction.
Click on a line that starts with a "+" to see the C code that Cython generated for it.

Raw output: Stickbreaking.c

+01: import numpy as np
  __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_numpy, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* … */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 02: cimport numpy as np
 03: cimport cython
 04: 
+05: @cython.wraparound(False)  # turn off negative ind
/* Python wrapper */
static PyObject *__pyx_pw_13Stickbreaking_1dp_posterior_stickbreaking(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_13Stickbreaking_1dp_posterior_stickbreaking = {"dp_posterior_stickbreaking", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13Stickbreaking_1dp_posterior_stickbreaking, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_13Stickbreaking_1dp_posterior_stickbreaking(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyArrayObject *__pyx_v_observations = 0;
  PyArrayObject *__pyx_v_dirichlet_process = 0;
  CYTHON_UNUSED __pyx_t_5numpy_float64_t __pyx_v_alpha;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dp_posterior_stickbreaking (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_observations,&__pyx_n_s_dirichlet_process,&__pyx_n_s_alpha,0};
  PyObject* values[3] = {0,0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_observations)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dirichlet_process)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("dp_posterior_stickbreaking", 1, 3, 3, 1); __PYX_ERR(0, 5, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_alpha)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("dp_posterior_stickbreaking", 1, 3, 3, 2); __PYX_ERR(0, 5, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "dp_posterior_stickbreaking") < 0)) __PYX_ERR(0, 5, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
    }
    __pyx_v_observations = ((PyArrayObject *)values[0]);
    __pyx_v_dirichlet_process = ((PyArrayObject *)values[1]);
    __pyx_v_alpha = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_alpha == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 6, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dp_posterior_stickbreaking", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 5, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("Stickbreaking.dp_posterior_stickbreaking", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_observations), __pyx_ptype_5numpy_ndarray, 1, "observations", 0))) __PYX_ERR(0, 6, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dirichlet_process), __pyx_ptype_5numpy_ndarray, 1, "dirichlet_process", 0))) __PYX_ERR(0, 6, __pyx_L1_error)
  __pyx_r = __pyx_pf_13Stickbreaking_dp_posterior_stickbreaking(__pyx_self, __pyx_v_observations, __pyx_v_dirichlet_process, __pyx_v_alpha);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13Stickbreaking_dp_posterior_stickbreaking(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_observations, PyArrayObject *__pyx_v_dirichlet_process, CYTHON_UNUSED __pyx_t_5numpy_float64_t __pyx_v_alpha) {
  double __pyx_v_V;
  int __pyx_v_i;
  int __pyx_v_j;
  int __pyx_v_sh;
  int __pyx_v_sh1;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_dirichlet_process;
  __Pyx_Buffer __pyx_pybuffer_dirichlet_process;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_observations;
  __Pyx_Buffer __pyx_pybuffer_observations;
  PyObject *__pyx_r = NULL;
  __Pyx_INCREF((PyObject *)__pyx_v_dirichlet_process);
  __pyx_pybuffer_observations.pybuffer.buf = NULL;
  __pyx_pybuffer_observations.refcount = 0;
  __pyx_pybuffernd_observations.data = NULL;
  __pyx_pybuffernd_observations.rcbuffer = &__pyx_pybuffer_observations;
  __pyx_pybuffer_dirichlet_process.pybuffer.buf = NULL;
  __pyx_pybuffer_dirichlet_process.refcount = 0;
  __pyx_pybuffernd_dirichlet_process.data = NULL;
  __pyx_pybuffernd_dirichlet_process.rcbuffer = &__pyx_pybuffer_dirichlet_process;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_observations.rcbuffer->pybuffer, (PyObject*)__pyx_v_observations, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 5, __pyx_L1_error)
  }
  __pyx_pybuffernd_observations.diminfo[0].strides = __pyx_pybuffernd_observations.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_observations.diminfo[0].shape = __pyx_pybuffernd_observations.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dirichlet_process.rcbuffer->pybuffer, (PyObject*)__pyx_v_dirichlet_process, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 5, __pyx_L1_error)
  }
  __pyx_pybuffernd_dirichlet_process.diminfo[0].strides = __pyx_pybuffernd_dirichlet_process.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dirichlet_process.diminfo[0].shape = __pyx_pybuffernd_dirichlet_process.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dirichlet_process.diminfo[1].strides = __pyx_pybuffernd_dirichlet_process.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dirichlet_process.diminfo[1].shape = __pyx_pybuffernd_dirichlet_process.rcbuffer->pybuffer.shape[1];
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dirichlet_process.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_observations.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("Stickbreaking.dp_posterior_stickbreaking", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dirichlet_process.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_observations.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_dirichlet_process);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__4 = PyTuple_Pack(8, __pyx_n_s_observations, __pyx_n_s_dirichlet_process, __pyx_n_s_alpha, __pyx_n_s_V, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_sh, __pyx_n_s_sh1); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__4);
  __Pyx_GIVEREF(__pyx_tuple__4);
/* … */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_13Stickbreaking_1dp_posterior_stickbreaking, 0, __pyx_n_s_dp_posterior_stickbreaking, NULL, __pyx_n_s_Stickbreaking, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_dp_posterior_stickbreaking, __pyx_t_2) < 0) __PYX_ERR(0, 5, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 06: def dp_posterior_stickbreaking(np.ndarray[np.float64_t, ndim=1] observations, np.ndarray[np.float64_t, ndim=2] dirichlet_process, np.float64_t alpha):
 07:     cdef double V
 08:     cdef int i, j
 09:     cdef int sh , sh1
 10: 
+11:     sh = dirichlet_process.shape[0]
  __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_dirichlet_process)); if (unlikely(__pyx_t_1 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 11, __pyx_L1_error)
  __pyx_v_sh = (__pyx_t_1[0]);
+12:     sh1 = len(observations)
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_observations)); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 12, __pyx_L1_error)
  __pyx_v_sh1 = __pyx_t_2;
 13: 
+14:     for i in range(sh1):
  __pyx_t_3 = __pyx_v_sh1;
  __pyx_t_4 = __pyx_t_3;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;
 15: 
+16:         V = 1.0#np.random.beta(1,alpha)#Beta_dist.rvs(1)
    __pyx_v_V = 1.0;
+17:         for j in range(sh):
    __pyx_t_6 = __pyx_v_sh;
    __pyx_t_7 = __pyx_t_6;
    for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
      __pyx_v_j = __pyx_t_8;
+18:             dirichlet_process[j,0]*= (1.0 - V)
      __pyx_t_9 = __pyx_v_j;
      __pyx_t_10 = 0;
      __pyx_t_11 = -1;
      if (__pyx_t_9 < 0) {
        __pyx_t_11 = 0;
      } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_dirichlet_process.diminfo[0].shape)) __pyx_t_11 = 0;
      if (__pyx_t_10 < 0) {
        __pyx_t_11 = 1;
      } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_dirichlet_process.diminfo[1].shape)) __pyx_t_11 = 1;
      if (unlikely(__pyx_t_11 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_11);
        __PYX_ERR(0, 18, __pyx_L1_error)
      }
      *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dirichlet_process.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_dirichlet_process.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_dirichlet_process.diminfo[1].strides) *= (1.0 - __pyx_v_V);
    }
 19: 
+20:         dirichlet_process = np.append(dirichlet_process,[[V,observations[i]]],axis=0)
    __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 20, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_append); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 20, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_12 = PyFloat_FromDouble(__pyx_v_V); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 20, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_10 = __pyx_v_i;
    __pyx_t_6 = -1;
    if (__pyx_t_10 < 0) {
      __pyx_t_6 = 0;
    } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_observations.diminfo[0].shape)) __pyx_t_6 = 0;
    if (unlikely(__pyx_t_6 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_6);
      __PYX_ERR(0, 20, __pyx_L1_error)
    }
    __pyx_t_14 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_observations.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_observations.diminfo[0].strides))); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 20, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_15 = PyList_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 20, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __Pyx_GIVEREF(__pyx_t_12);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_15, 0, __pyx_t_12)) __PYX_ERR(0, 20, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_14);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_15, 1, __pyx_t_14)) __PYX_ERR(0, 20, __pyx_L1_error);
    __pyx_t_12 = 0;
    __pyx_t_14 = 0;
    __pyx_t_14 = PyList_New(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 20, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_GIVEREF(__pyx_t_15);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_14, 0, __pyx_t_15)) __PYX_ERR(0, 20, __pyx_L1_error);
    __pyx_t_15 = 0;
    __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 20, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __Pyx_INCREF((PyObject *)__pyx_v_dirichlet_process);
    __Pyx_GIVEREF((PyObject *)__pyx_v_dirichlet_process);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 0, ((PyObject *)__pyx_v_dirichlet_process))) __PYX_ERR(0, 20, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_14);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_14)) __PYX_ERR(0, 20, __pyx_L1_error);
    __pyx_t_14 = 0;
    __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 20, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_axis, __pyx_int_0) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
    __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_15, __pyx_t_14); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 20, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 20, __pyx_L1_error)
    __pyx_t_16 = ((PyArrayObject *)__pyx_t_12);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dirichlet_process.rcbuffer->pybuffer);
      __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dirichlet_process.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack);
      if (unlikely(__pyx_t_6 < 0)) {
        PyErr_Fetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dirichlet_process.rcbuffer->pybuffer, (PyObject*)__pyx_v_dirichlet_process, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_19);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
        }
        __pyx_t_17 = __pyx_t_18 = __pyx_t_19 = 0;
      }
      __pyx_pybuffernd_dirichlet_process.diminfo[0].strides = __pyx_pybuffernd_dirichlet_process.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dirichlet_process.diminfo[0].shape = __pyx_pybuffernd_dirichlet_process.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dirichlet_process.diminfo[1].strides = __pyx_pybuffernd_dirichlet_process.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dirichlet_process.diminfo[1].shape = __pyx_pybuffernd_dirichlet_process.rcbuffer->pybuffer.shape[1];
      if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 20, __pyx_L1_error)
    }
    __pyx_t_16 = 0;
    __Pyx_DECREF_SET(__pyx_v_dirichlet_process, ((PyArrayObject *)__pyx_t_12));
    __pyx_t_12 = 0;
  }
 21: 
 22: 
+23:     return dirichlet_process
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_dirichlet_process);
  __pyx_r = ((PyObject *)__pyx_v_dirichlet_process);
  goto __pyx_L0;