Struct AnyModulePlaceholder¶
Defined in File any_module_holder.h
Page Contents
Inheritance Relationships¶
Base Type¶
public torch::nn::AnyValue::Placeholder
Derived Type¶
public torch::nn::AnyModuleHolder< ModuleType, ArgumentTypes >
(Template Struct AnyModuleHolder)
Struct Documentation¶
-
struct AnyModulePlaceholder : public torch::nn::AnyValue::Placeholder¶
The static type of the object we store in the
AnyModule
, which erases the actual type, but allows us to callforward()
on the underlying module.Subclassed by torch::nn::AnyModuleHolder< ModuleType, ArgumentTypes >
Public Functions
-
virtual std::shared_ptr<Module> ptr() = 0¶
Returns std::shared_ptr<Module> pointing to the erased module.
-
virtual std::unique_ptr<AnyModulePlaceholder> copy() const = 0¶
Returns a
AnyModulePlaceholder
with a shallow copy of thisAnyModule
.
-
virtual std::unique_ptr<AnyModulePlaceholder> clone_module(std::optional<Device> device) const = 0¶
Returns a
AnyModulePlaceholder
with a deep copy of thisAnyModule
.
-
virtual std::shared_ptr<Module> ptr() = 0¶