Class UnflattenImpl#
Defined in File linear.h
Page Contents
Inheritance Relationships#
Base Type#
public torch::nn::Cloneable< UnflattenImpl >
(Template Class Cloneable)
Class Documentation#
-
class UnflattenImpl : public torch::nn::Cloneable<UnflattenImpl>#
A placeholder for unflatten operator See https://pytorch.org/docs/main/generated/torch.nn.Unflatten.html to learn about the exact behavior of this module.
See the documentation for
torch::nn::UnflattenOptions
class to learn what constructor arguments are supported for this module.Example:
Unflatten model(UnflattenOptions(0, {2, 2})); Unflatten model(UnflattenOptions("B", {{"B1", 2}, {"B2", 2}}));
Public Functions
-
inline UnflattenImpl(int64_t dim, std::vector<int64_t> sizes)#
-
inline UnflattenImpl(std::string dimname, UnflattenOptions::namedshape_t namedshape)#
-
explicit UnflattenImpl(UnflattenOptions options_)#
-
virtual void reset() override#
reset()
must perform initialization of all members with reference semantics, most importantly parameters, buffers and submodules.
-
virtual void pretty_print(std::ostream &stream) const override#
Pretty prints the
Unflatten
module into the givenstream
.
-
Tensor forward(const Tensor &input)#
Applies an unflatten transform on the
input
.
Public Members
-
UnflattenOptions options#
The options used to configure this module.
-
inline UnflattenImpl(int64_t dim, std::vector<int64_t> sizes)#