-
Notifications
You must be signed in to change notification settings - Fork 334
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/20180401-file-format-converter' of ml-git.ubiq.…
…sony.co.jp:nnabla/nnabla into feature/20180401-file-format-converter
- Loading branch information
Showing
21 changed files
with
6,045 additions
and
588 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
// Copyright (c) 2017 Sony Corporation. All Rights Reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
// *WARNING* | ||
// THIS FILE IS AUTO-GENERATED DUMMY CODE BY CODE GENERATOR. | ||
// PLEASE IMPLEMENT REAL CODE AND DELETE THIS MESSAGE SOON. | ||
// If you want to change dummy code, edit following files. | ||
// - build-tools/code_generator/function_generator/generate_include_nbla_function_hpp.py | ||
// - build-tools/code_generator/templates/include_nbla_function_hpp_template.hpp | ||
|
||
|
||
/** BroadcastTo | ||
*/ | ||
#ifndef __NBLA_FUNCTION_BROADCASTTO_HPP__ | ||
#define __NBLA_FUNCTION_BROADCASTTO_HPP__ | ||
|
||
#include <nbla/cpu.hpp> | ||
#include <nbla/function.hpp> | ||
#include <nbla/function_registry.hpp> | ||
|
||
namespace nbla { | ||
|
||
NBLA_REGISTER_FUNCTION_HEADER(BroadcastTo, int); | ||
|
||
/** | ||
@todo PLACE HERE FUNCTION DOCUMENTATION. | ||
*/ | ||
template <typename T> | ||
class BroadcastTo : public BaseFunction<int> { | ||
protected: | ||
int axis_; | ||
|
||
public: | ||
BroadcastTo(const Context &ctx, int axis) : BaseFunction<int>(ctx, axis), axis_(axis) {} | ||
virtual ~BroadcastTo() {} | ||
virtual shared_ptr<Function> copy() const { | ||
return create_BroadcastTo(ctx_, axis_); | ||
} | ||
virtual vector<dtypes> in_types() { | ||
return vector<dtypes>{ get_dtype<T>(), get_dtype<T>() }; | ||
} | ||
virtual vector<dtypes> out_types() { | ||
return vector<dtypes>{ get_dtype<T>() }; | ||
} | ||
virtual int min_inputs() { return 2; } | ||
virtual int min_outputs() { return 1; } | ||
virtual string name() { return "BroadcastTo"; } | ||
virtual vector<string> allowed_array_classes() { | ||
return SingletonManager::get<Cpu>()->array_classes(); | ||
} | ||
|
||
protected: | ||
NBLA_API virtual void setup_impl(const Variables &inputs, const Variables &outputs); | ||
NBLA_API virtual void forward_impl(const Variables &inputs, const Variables &outputs); | ||
NBLA_API virtual void backward_impl(const Variables &inputs, const Variables &outputs, | ||
const vector<bool> &propagate_down, | ||
const vector<bool> &accum); | ||
}; | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,6 +40,7 @@ | |
'scikit-image', | ||
'scipy', | ||
'tqdm', | ||
'onnx', | ||
] | ||
|
||
|
||
|
Oops, something went wrong.