@@ -90,7 +90,7 @@ class Module : public ObjectRef {
9090 * This function will return PackedFunc(nullptr) if function do not exist.
9191 * \note Implemented in packed_func.cc
9292 */
93- inline PackedFunc GetFunction (const std::string & name, bool query_imports = false );
93+ inline PackedFunc GetFunction (const String & name, bool query_imports = false );
9494 // The following functions requires link with runtime.
9595 /* !
9696 * \brief Import another module into this module.
@@ -111,7 +111,7 @@ class Module : public ObjectRef {
111111 * \note This function won't load the import relationship.
112112 * Re-create import relationship by calling Import.
113113 */
114- TVM_DLL static Module LoadFromFile (const std::string & file_name, const std::string & format = " " );
114+ TVM_DLL static Module LoadFromFile (const String & file_name, const String & format = " " );
115115 // refer to the corresponding container.
116116 using ContainerType = ModuleNode;
117117 friend class ModuleNode ;
@@ -165,14 +165,13 @@ class TVM_DLL ModuleNode : public Object {
165165 * If the function need resource from the module(e.g. late linking),
166166 * it should capture sptr_to_self.
167167 */
168- virtual PackedFunc GetFunction (const std::string& name,
169- const ObjectPtr<Object>& sptr_to_self) = 0;
168+ virtual PackedFunc GetFunction (const String& name, const ObjectPtr<Object>& sptr_to_self) = 0;
170169 /* !
171170 * \brief Save the module to file.
172171 * \param file_name The file to be saved to.
173172 * \param format The format of the file.
174173 */
175- virtual void SaveToFile (const std::string & file_name, const std::string & format);
174+ virtual void SaveToFile (const String & file_name, const String & format);
176175 /* !
177176 * \brief Save the module to binary stream.
178177 * \param stream The binary stream to save to.
@@ -186,12 +185,12 @@ class TVM_DLL ModuleNode : public Object {
186185 * \param format Format of the source code, can be empty by default.
187186 * \return Possible source code when available.
188187 */
189- virtual std::string GetSource (const std::string & format = " " );
188+ virtual String GetSource (const String & format = " " );
190189 /* !
191190 * \brief Get the format of the module, when available.
192191 * \return Possible format when available.
193192 */
194- virtual std::string GetFormat ();
193+ virtual String GetFormat ();
195194 /* !
196195 * \brief Get packed function from current module by name.
197196 *
@@ -201,7 +200,7 @@ class TVM_DLL ModuleNode : public Object {
201200 * This function will return PackedFunc(nullptr) if function do not exist.
202201 * \note Implemented in packed_func.cc
203202 */
204- PackedFunc GetFunction (const std::string & name, bool query_imports = false );
203+ PackedFunc GetFunction (const String & name, bool query_imports = false );
205204 /* !
206205 * \brief Import another module into this module.
207206 * \param other The module to be imported.
@@ -217,7 +216,7 @@ class TVM_DLL ModuleNode : public Object {
217216 * \param name name of the function.
218217 * \return The corresponding function.
219218 */
220- const PackedFunc* GetFuncFromEnv (const std::string & name);
219+ const PackedFunc* GetFuncFromEnv (const String & name);
221220 /* ! \return The module it imports from */
222221 const std::vector<Module>& imports () const { return imports_; }
223222
@@ -268,7 +267,7 @@ class TVM_DLL ModuleNode : public Object {
268267 * \param target The target module name.
269268 * \return Whether runtime is enabled.
270269 */
271- TVM_DLL bool RuntimeEnabled (const std::string & target);
270+ TVM_DLL bool RuntimeEnabled (const String & target);
272271
273272/* ! \brief namespace for constant symbols */
274273namespace symbol {
0 commit comments