2 // Copyright 2016-2018 Intel Corporation.
4 // This software and the related documents are Intel copyrighted materials,
5 // and your use of them is governed by the express license under which they
6 // were provided to you (End User License Agreement for the Intel(R) Software
7 // Development Products (Version May 2017)). Unless the License provides
8 // otherwise, you may not use, modify, copy, publish, distribute, disclose or
9 // transmit this software or the related documents without Intel's prior
10 // written permission.
12 // This software and the related documents are provided as is, with no
13 // express or implied warranties, other than those that are expressly
14 // stated in the License.
23 namespace MKLDNNPlugin {
26 * Utility class to dump blob contant in plain format.
27 * Every layout information will be lost.
29 * In case of low precision blob it allow to store
30 * with using scaling factors per channel.
31 * NB! Channel is a second dimension for all blob types.
34 InferenceEngine::Blob::Ptr _blob;
35 InferenceEngine::Blob::Ptr _scales;
38 BlobDumper() = default;
39 BlobDumper(const BlobDumper&) = default;
40 BlobDumper& operator = (BlobDumper&&) = default;
42 explicit BlobDumper(const InferenceEngine::Blob::Ptr blob):_blob(blob) {}
44 static BlobDumper read(const std::string &file_path);
45 static BlobDumper read(std::istream &stream);
47 void dump(const std::string &file_path);
48 void dump(std::ostream &stream);
50 void dumpAsTxt(const std::string file_path);
51 void dumpAsTxt(std::ostream &stream);
53 BlobDumper& withScales(InferenceEngine::Blob::Ptr scales);
54 BlobDumper& withoutScales();
56 const InferenceEngine::Blob::Ptr& getScales() const;
58 InferenceEngine::Blob::Ptr get();
59 InferenceEngine::Blob::Ptr getRealValue();
62 } // namespace MKLDNNPlugin