yuxihu commented on a change in pull request #13543: Chi_square_check for discrete distribution fix URL: https://github.com/apache/incubator-mxnet/pull/13543#discussion_r238923920
########## File path: python/mxnet/test_utils.py ########## @@ -1915,8 +1915,8 @@ def chi_square_check(generator, buckets, probs, nsamples=1000000): if continuous_dist: sample_bucket_ids = sample_bucket_ids // 2 obs_freq = np.zeros(shape=len(buckets), dtype=np.int) - for i in range(len(buckets)): - obs_freq[i] = (sample_bucket_ids == i).sum() + for i, _ in enumerate(buckets): + obs_freq[i] = (sample_bucket_ids == buckets[i]).astype('uint8').sum() Review comment: Are you sure this work? (sample_bucket_ids == buckets[i]) will return a bool object. you might hit AttributeError here. Please double check. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services