Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
shendiaomo committed Oct 26, 2020
1 parent 62c2264 commit cb02186
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cgotorch/cgotorch.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "cgotorch/init.h"
#include "cgotorch/memory.h"
#include "cgotorch/optim.h"
#include "cgotorch/parallel.h"
#include "cgotorch/pickle.h"
#include "cgotorch/tensor.h"
#include "cgotorch/torch.h"
#include "cgotorch/parallel.h"
5 changes: 3 additions & 2 deletions cgotorch/parallel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#ifdef WITH_CUDA
#include <torch/nn/parallel/data_parallel.h>
#endif

#include "cgotorch/parallel.h"

typedef Tensor (*ForwardMethod)(void *, Tensor);
Expand All @@ -12,13 +13,13 @@ struct goModule {
char *m_;
ForwardMethod f_;
goModule(char *m, void *f) : m_(m), f_(reinterpret_cast<ForwardMethod>(f)) {}
at::Tensor forward(at::Tensor input) {
at::Tensor forward(at::Tensor input) { // NOLINT: include_what_you_use
// TODO(shendiaomo): check the return value of `f_`
return *f_(m_, &input);
}
};

const char *DataParallel(char *go_module, void* f, Tensor input, Device *device,
const char *DataParallel(char *go_module, void *f, Tensor input, Device *device,
int64_t size, Device *output, int64_t dim) {
#ifdef WITH_CUDA
try {
Expand Down
2 changes: 1 addition & 1 deletion cgotorch/parallel.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ extern "C" {
// Parallel
////////////////////////////////////////////////////////////////////////////////

const char *DataParallel(char *go_module, void* f, Tensor input, Device *device,
const char *DataParallel(char *go_module, void *f, Tensor input, Device *device,
int64_t size, Device *output, int64_t dim);
#ifdef __cplusplus
}
Expand Down

0 comments on commit cb02186

Please sign in to comment.