1 /** 2 * Copyright 2021 Huawei Technologies Co., Ltd 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 #ifndef MINDSPORE_CCSRC_DEBUG_RDR_STRING_RECORDER_H_ 17 #define MINDSPORE_CCSRC_DEBUG_RDR_STRING_RECORDER_H_ 18 19 #include <string> 20 #include <memory> 21 22 #include "debug/rdr/base_recorder.h" 23 namespace mindspore { 24 class StringRecorder : public BaseRecorder { 25 public: StringRecorder()26 StringRecorder() : BaseRecorder() {} StringRecorder(const std::string & module,const std::string & name,const std::string & data)27 StringRecorder(const std::string &module, const std::string &name, const std::string &data) 28 : BaseRecorder(module, name), data_(data) {} ~StringRecorder()29 ~StringRecorder() {} 30 void Export() override; 31 32 private: 33 std::string data_; 34 }; 35 using StringRecorderPtr = std::shared_ptr<StringRecorder>; 36 } // namespace mindspore 37 #endif // MINDSPORE_CCSRC_DEBUG_RDR_STRING_RECORDER_H_ 38