Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

register factory methods for proper garbage collection #4322

Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/interfaces/swig/factory.i
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,18 @@
%include <shogun/util/factory.h>

%template(features) shogun::features<float64_t>;

/* These functions return a new Object */
%newobject distance(const std::string&);
%newobject evaluation(const std::string&);
%newobject kernel(const std::string&);
%newobject kernel(SGMatrix<float64_t>);
%newobject machine(const std::string&);
%newobject multiclass_strategy(const std::string&);
%newobject ecoc_encoder(const std::string&);
%newobject ecoc_decoder(const std::string&);
%newobject features(SGMatrix<T>);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

float64_t

%newobject features(CFile*, EPrimitiveType);
%newobject features_subset(CFeatures*, SGVector<index_t>, EPrimitiveType);
%newobject labels(CFile*);
%newobject csv_file(std::string, char);