<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _iterate_marginal_coef_slices(self, i):
 """iterator of indices into tensor's coef vector for marginal term i's coefs takes a tensor_term and returns an iterator of indices that chop up the tensor's coef vector into slices belonging to term i Parameters i : int, index of marginal term Yields ------ np.ndarray of ints """

        dims = [term_.n_coefs for term_ in self]

        # make all linear indices
        idxs = np.arange(np.prod(dims))

        # reshape indices to a Nd matrix
        idxs = idxs.reshape(dims)

        # reshape to a 2d matrix, where we can loop over rows
        idxs = np.moveaxis(idxs, i, 0).reshape(idxs.shape[i], int(idxs.size/idxs.shape[i]))

        # loop over rows
        for slice_ in idxs.T:
            yield slice_