mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 05:34:18 +08:00
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/33851 Rationale and context described in #33828. Script to reproduce the move: https://gist.github.com/suo/16cbefaaeb67ca5a7c6caffd49b7f6e9 ghstack-source-id: 99079645 Test Plan: Make sure CI passes Reviewed By: jamesr66a Differential Revision: D20133869 fbshipit-source-id: 390e9241a9c85366d9005c492ac31f10aa96488e
25 lines
685 B
C++
25 lines
685 B
C++
#pragma once
|
|
|
|
#include <ATen/core/ivalue.h>
|
|
#include <ATen/core/jit_type.h>
|
|
|
|
namespace torch {
|
|
namespace jit {
|
|
|
|
TORCH_API at::TypePtr getCustomClass(const std::string& name);
|
|
|
|
TORCH_API bool isCustomClass(const c10::IValue& v);
|
|
|
|
using GetCustomClassFnType = at::TypePtr (*)(const std::string&);
|
|
// Use this to set the function for retrieving custom classes
|
|
//
|
|
// This is necessary because the custom classes implementation
|
|
// is not in ATen core, but the schema type parser is, which
|
|
// can resolve custom classes as type expressions.
|
|
TORCH_API void setGetCustomClassFn(GetCustomClassFnType fn);
|
|
|
|
TORCH_API int register_custom_class_handler();
|
|
|
|
} // namespace jit
|
|
} // namespace torch
|