forked from microsoft/onnxruntime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request microsoft#37 from NonStatic2014/trmccorm/update_ma…
…ster3 Merge upstream master again to settle merge conflicts
- Loading branch information
Showing
47 changed files
with
861 additions
and
451 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
36 changes: 0 additions & 36 deletions
36
csharp/src/Microsoft.ML.OnnxRuntime/Microsoft.ML.OnnxRuntime.props
This file was deleted.
Oops, something went wrong.
16 changes: 0 additions & 16 deletions
16
csharp/src/Microsoft.ML.OnnxRuntime/Microsoft.ML.OnnxRuntime.targets
This file was deleted.
Oops, something went wrong.
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
File renamed without changes.
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,29 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
#include "core/providers/cpu/activation/activations.h" | ||
#include "contrib_op_activations.h" | ||
|
||
namespace onnxruntime { | ||
namespace contrib { | ||
|
||
ONNX_CPU_OPERATOR_KERNEL( | ||
ParametricSoftplus, | ||
1, | ||
KernelDefBuilder().MayInplace(0, 0).TypeConstraint("T", DataTypeImpl::GetTensorType<float>()), | ||
ParametricSoftplus<float>); | ||
|
||
ONNX_CPU_OPERATOR_KERNEL( | ||
ScaledTanh, | ||
1, | ||
KernelDefBuilder().MayInplace(0, 0).TypeConstraint("T", DataTypeImpl::GetTensorType<float>()), | ||
ScaledTanh<float>); | ||
|
||
ONNX_CPU_OPERATOR_KERNEL( | ||
ThresholdedRelu, | ||
1, | ||
KernelDefBuilder().MayInplace(0, 0).TypeConstraint("T", DataTypeImpl::GetTensorType<float>()), | ||
ThresholdedRelu<float>); | ||
|
||
} // namespace contrib | ||
} // namespace onnxruntime |
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,31 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
#pragma once | ||
|
||
#include "core/common/common.h" | ||
#include "core/framework/op_kernel.h" | ||
#include "core/util/math_cpuonly.h" | ||
|
||
namespace onnxruntime { | ||
namespace contrib { | ||
|
||
template <typename T> | ||
class ScaledTanh final : public OpKernel { | ||
public: | ||
ScaledTanh(const OpKernelInfo& info) | ||
: OpKernel(info), alpha_(info.GetAttrOrDefault("alpha", 1.0f)), beta_(info.GetAttrOrDefault("beta", 1.0f)) {} | ||
|
||
Status Compute(OpKernelContext* context) const override { | ||
const Tensor* X = context->Input<Tensor>(0); | ||
Tensor* Y = context->Output(0, X->Shape()); | ||
EIGEN_Y = (T)alpha_ * (EIGEN_X * (T)beta_).tanh(); | ||
return Status::OK(); | ||
} | ||
|
||
private: | ||
const float alpha_; | ||
const float beta_; | ||
}; | ||
} // namespace contrib | ||
} // namespace onnxruntime |
4 changes: 3 additions & 1 deletion
4
...runtime/core/providers/cpu/tensor/crop.cc → onnxruntime/contrib_ops/cpu/crop.cc
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 |
---|---|---|
@@ -1,12 +1,14 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
#include "core/providers/cpu/tensor/crop.h" | ||
#include "crop.h" | ||
|
||
namespace onnxruntime { | ||
namespace contrib { | ||
ONNX_CPU_OPERATOR_KERNEL( | ||
Crop, | ||
1, | ||
KernelDefBuilder().TypeConstraint("T", DataTypeImpl::GetTensorType<float>()), | ||
Crop<float>); | ||
} | ||
} // namespace onnxruntime |
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,25 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
#include "element_wise_exp_ops.h" | ||
#include "core/providers/cpu/math/element_wise_ops.h" | ||
|
||
namespace onnxruntime { | ||
namespace contrib { | ||
|
||
ONNX_CPU_OPERATOR_KERNEL( | ||
Affine, | ||
1, | ||
KernelDefBuilder().TypeConstraint("T", DataTypeImpl::GetTensorType<float>()), | ||
Affine<float>); | ||
|
||
template <> | ||
Status Affine<float>::Compute(OpKernelContext* ctx) const { | ||
auto& X = *ctx->Input<Tensor>(0); | ||
auto& Y = *ctx->Output(0, X.Shape()); | ||
MakeEigenArrayMap<float>(Y) = alpha_ * MakeEigenArrayMap<float>(X) + beta_; | ||
return Status::OK(); | ||
} | ||
|
||
} // namespace contrib | ||
} // namespace onnxruntime |
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,28 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
#pragma once | ||
|
||
#include "core/common/common.h" | ||
#include "core/framework/op_kernel.h" | ||
#include "core/util/math_cpuonly.h" | ||
|
||
namespace onnxruntime { | ||
namespace contrib { | ||
template <typename T> | ||
class Affine final : public OpKernel { | ||
public: | ||
Affine(const OpKernelInfo& info) : OpKernel(info) { | ||
// Either model-supplied or default values should be returned for alpha and beta | ||
ORT_ENFORCE(info.GetAttr("alpha", &alpha_).IsOK()); | ||
ORT_ENFORCE(info.GetAttr("beta", &beta_).IsOK()); | ||
} | ||
|
||
Status Compute(OpKernelContext* context) const override; | ||
|
||
private: | ||
float alpha_; | ||
float beta_; | ||
}; | ||
} // namespace contrib | ||
} // namespace onnxruntime |
Oops, something went wrong.