From 2abaa83c8b671f4f8092956df6a7f5717f40d855 Mon Sep 17 00:00:00 2001 From: Amit Agarwal Date: Fri, 11 Sep 2015 00:03:12 -0700 Subject: [PATCH] Fixed a bug in an assertion in the HTKMLFReader pertaining checking for distributed minibatch reading support --- DataReader/HTKMLFReader/HTKMLFReader.cpp | 2 +- DataReader/HTKMLFReader/HTKMLFReader.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DataReader/HTKMLFReader/HTKMLFReader.cpp b/DataReader/HTKMLFReader/HTKMLFReader.cpp index fd53926f3..78c5f4e73 100644 --- a/DataReader/HTKMLFReader/HTKMLFReader.cpp +++ b/DataReader/HTKMLFReader/HTKMLFReader.cpp @@ -643,7 +643,7 @@ namespace Microsoft { namespace MSR { namespace CNTK { void HTKMLFReader::StartDistributedMinibatchLoop(size_t mbSize, size_t epoch, size_t subsetNum, size_t numSubsets, size_t requestedEpochSamples /*= requestDataSize*/) { assert(subsetNum < numSubsets); - assert(this->SupportsDistributedMBRead() || ((subsetNum == 0) && (numSubsets == 1))); + assert(((subsetNum == 0) && (numSubsets == 1)) || this->SupportsDistributedMBRead()); m_mbSize = mbSize; diff --git a/DataReader/HTKMLFReader/HTKMLFReader.h b/DataReader/HTKMLFReader/HTKMLFReader.h index 2f1b0c5be..cf9daa9d0 100644 --- a/DataReader/HTKMLFReader/HTKMLFReader.h +++ b/DataReader/HTKMLFReader/HTKMLFReader.h @@ -182,7 +182,7 @@ public: virtual bool SupportsDistributedMBRead() const override { - return m_frameSource->supportsbatchsubsetting(); + return ((m_frameSource != nullptr) && m_frameSource->supportsbatchsubsetting()); } virtual void StartDistributedMinibatchLoop(size_t mbSize, size_t epoch, size_t subsetNum, size_t numSubsets, size_t requestedEpochSamples = requestDataSize) override;