swh:1:snp:f50ab94432af916b5fb8b4ad831e8dddded77084
Raw File
Tip revision: 40a306f49a93415933671c333f5ff17e9ac117b5 authored by Zhou Wang on 28 July 2017, 12:18:05 UTC
use assembly reference to fix error using nuget restore
Tip revision: 40a306f
ReaderUtil.cpp
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.md file in the project root for full license information.
//

#include "Config.h"
#include "DataReader.h"

namespace CNTK {
    using namespace Microsoft::MSR::CNTK;

    size_t GetRandomizationWindowFromConfig(const ConfigParameters& config)
    {
        wstring randomizeString = config(L"randomize", wstring());
        if (!_wcsicmp(randomizeString.c_str(), L"none")) // TODO: don't support case-insensitive option strings in the new reader
        {
            // "none" is only accepted to be backwards-compatible (DoWriteOutput() in EvalActions.cpp
            // inserts this magic constant into the reader config to prevent it from shuffling the input).
            // In user-defined configurations, 'randomize' should be a boolean.
            return randomizeNone;
        }

        bool randomize = config(L"randomize", true);

        if (!randomize)
        {
            return randomizeNone;
        }

        if (config.Exists(L"randomizationWindow"))
        {
            return config(L"randomizationWindow");
        }

        return randomizeAuto;
    }

}
back to top