ó ùµÈ[c@s<dZdgZddlmZdejfd„ƒYZdS(sDataset sampler.tIntervalSampleri(tsamplercBs,eZdZed„Zd„Zd„ZRS(s+Samples elements from [0, length) at fixed intervals. Parameters ---------- length : int Length of the sequence. interval : int The number of items to skip between two samples. rollover : bool, default True Whether to start again from the first skipped item after reaching the end. If true, this sampler would start again from the first skipped item until all items are visited. Otherwise, iteration stops when end is reached and skipped items are ignored. Examples -------- >>> sampler = contrib.data.IntervalSampler(13, interval=3) >>> list(sampler) [0, 3, 6, 9, 12, 1, 4, 7, 10, 2, 5, 8, 11] >>> sampler = contrib.data.IntervalSampler(13, interval=3, rollover=False) >>> list(sampler) [0, 3, 6, 9, 12] cCsC||ks$tdj||ƒƒ‚||_||_||_dS(Ns6Interval {} must be smaller than or equal to length {}(tAssertionErrortformatt_lengtht _intervalt _rollover(tselftlengthtintervaltrollover((s`/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/gluon/contrib/data/sampler.pyt__init__1s   ccsUxNt|jr|jndƒD].}x%t||j|jƒD] }|Vq>WqWdS(Ni(trangeRRR(Rtitj((s`/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/gluon/contrib/data/sampler.pyt__iter__8s%cCs|jS(N(R(R((s`/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/gluon/contrib/data/sampler.pyt__len__=s(t__name__t __module__t__doc__tTrueR RR(((s`/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/gluon/contrib/data/sampler.pyRs  N(Rt__all__tdataRtSamplerR(((s`/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/gluon/contrib/data/sampler.pyts