(313315d (Wed Dec 23 23:39:47 2020 -0800))
#include "open3d/ml/ShapeChecking.h"
#include "tensorflow/core/framework/op_kernel.h"
#include "tensorflow/core/framework/shape_inference.h"
#include "tensorflow/core/framework/tensor.h"
#include "tensorflow/core/lib/core/errors.h"
Go to the source code of this file.
|
#define | CHECK_SHAPE_HANDLE(ctx, shape_handle, ...) |
|
#define | CHECK_SHAPE_HANDLE_COMBINE_FIRST_DIMS(ctx, shape_handle, ...) |
|
#define | CHECK_SHAPE_HANDLE_IGNORE_FIRST_DIMS(ctx, shape_handle, ...) |
|
#define | CHECK_SHAPE_HANDLE_COMBINE_LAST_DIMS(ctx, shape_handle, ...) |
|
#define | CHECK_SHAPE_HANDLE_IGNORE_LAST_DIMS(ctx, shape_handle, ...) |
|
#define | CHECK_SHAPE(ctx, tensor, ...) |
|
#define | CHECK_SHAPE_COMBINE_FIRST_DIMS(ctx, tensor, ...) |
|
#define | CHECK_SHAPE_IGNORE_FIRST_DIMS(ctx, tensor, ...) |
|
#define | CHECK_SHAPE_COMBINE_LAST_DIMS(ctx, tensor, ...) |
|
#define | CHECK_SHAPE_IGNORE_LAST_DIMS(ctx, tensor, ...) |
|
|
std::vector< open3d::ml::op_util::DimValue > | GetShapeVector (::tensorflow::shape_inference::InferenceContext *c, ::tensorflow::shape_inference::ShapeHandle shape_handle) |
|
template<open3d::ml::op_util::CSOpt Opt = open3d::ml::op_util::CSOpt::NONE, class TDimX , class... TArgs> |
std::tuple< bool, std::string > | CheckShape (::tensorflow::shape_inference::InferenceContext *c, ::tensorflow::shape_inference::ShapeHandle shape_handle, TDimX &&dimex, TArgs &&... args) |
|
std::vector< open3d::ml::op_util::DimValue > | GetShapeVector (const tensorflow::Tensor &tensor) |
|
template<open3d::ml::op_util::CSOpt Opt = open3d::ml::op_util::CSOpt::NONE, class TDimX , class... TArgs> |
std::tuple< bool, std::string > | CheckShape (const tensorflow::Tensor &tensor, TDimX &&dimex, TArgs &&... args) |
|
template<class TDimX , class... TArgs> |
::tensorflow::shape_inference::ShapeHandle | MakeShapeHandle (::tensorflow::shape_inference::InferenceContext *ctx, TDimX &&dimex, TArgs &&... args) |
|
◆ CHECK_SHAPE
#define CHECK_SHAPE |
( |
|
ctx, |
|
|
|
tensor, |
|
|
|
... |
|
) |
| |
Value:do { \
bool cs_success_; \
std::string cs_errstr_; \
std::tie(cs_success_, cs_errstr_) =
CheckShape(tensor, __VA_ARGS__); \
OP_REQUIRES( \
ctx, cs_success_, \
tensorflow::errors::InvalidArgument( \
"invalid shape for '" #tensor "', " + cs_errstr_)); \
} while (0)
std::tuple< bool, std::string > CheckShape(::tensorflow::shape_inference::InferenceContext *c, ::tensorflow::shape_inference::ShapeHandle shape_handle, TDimX &&dimex, TArgs &&... args)
Definition: TensorFlowHelper.h:58
◆ CHECK_SHAPE_COMBINE_FIRST_DIMS
#define CHECK_SHAPE_COMBINE_FIRST_DIMS |
( |
|
ctx, |
|
|
|
tensor, |
|
|
|
... |
|
) |
| |
Value:do { \
bool cs_success_; \
std::string cs_errstr_; \
std::tie(cs_success_, cs_errstr_) = \
CheckShape<CSOpt::COMBINE_FIRST_DIMS>(tensor, __VA_ARGS__); \
OP_REQUIRES( \
ctx, cs_success_, \
tensorflow::errors::InvalidArgument( \
"invalid shape for '" #tensor "', " + cs_errstr_)); \
} while (0)
◆ CHECK_SHAPE_COMBINE_LAST_DIMS
#define CHECK_SHAPE_COMBINE_LAST_DIMS |
( |
|
ctx, |
|
|
|
tensor, |
|
|
|
... |
|
) |
| |
Value:do { \
bool cs_success_; \
std::string cs_errstr_; \
std::tie(cs_success_, cs_errstr_) = \
CheckShape<CSOpt::COMBINE_LAST_DIMS>(tensor, __VA_ARGS__); \
OP_REQUIRES( \
ctx, cs_success_, \
tensorflow::errors::InvalidArgument( \
"invalid shape for '" #tensor "', " + cs_errstr_)); \
} while (0)
◆ CHECK_SHAPE_HANDLE
#define CHECK_SHAPE_HANDLE |
( |
|
ctx, |
|
|
|
shape_handle, |
|
|
|
... |
|
) |
| |
Value:do { \
bool cs_success_; \
std::string cs_errstr_; \
std::tie(cs_success_, cs_errstr_) = \
CheckShape(ctx, shape_handle, __VA_ARGS__); \
if (TF_PREDICT_FALSE(!cs_success_)) { \
return tensorflow::errors::InvalidArgument( \
"invalid shape for '" #shape_handle "', " + cs_errstr_); \
} \
} while (0)
◆ CHECK_SHAPE_HANDLE_COMBINE_FIRST_DIMS
#define CHECK_SHAPE_HANDLE_COMBINE_FIRST_DIMS |
( |
|
ctx, |
|
|
|
shape_handle, |
|
|
|
... |
|
) |
| |
Value:do { \
bool cs_success_; \
std::string cs_errstr_; \
std::tie(cs_success_, cs_errstr_) = \
CheckShape<CSOpt::COMBINE_FIRST_DIMS>(ctx, shape_handle, \
__VA_ARGS__); \
if (TF_PREDICT_FALSE(!cs_success_)) { \
return tensorflow::errors::InvalidArgument( \
"invalid shape for '" #shape_handle "', " + cs_errstr_); \
} \
} while (0)
◆ CHECK_SHAPE_HANDLE_COMBINE_LAST_DIMS
#define CHECK_SHAPE_HANDLE_COMBINE_LAST_DIMS |
( |
|
ctx, |
|
|
|
shape_handle, |
|
|
|
... |
|
) |
| |
Value:do { \
bool cs_success_; \
std::string cs_errstr_; \
std::tie(cs_success_, cs_errstr_) = \
CheckShape<CSOpt::COMBINE_LAST_DIMS>(ctx, shape_handle, \
__VA_ARGS__); \
if (TF_PREDICT_FALSE(!cs_success_)) { \
return tensorflow::errors::InvalidArgument( \
"invalid shape for '" #shape_handle "', " + cs_errstr_); \
} \
} while (0)
◆ CHECK_SHAPE_HANDLE_IGNORE_FIRST_DIMS
#define CHECK_SHAPE_HANDLE_IGNORE_FIRST_DIMS |
( |
|
ctx, |
|
|
|
shape_handle, |
|
|
|
... |
|
) |
| |
Value:do { \
bool cs_success_; \
std::string cs_errstr_; \
std::tie(cs_success_, cs_errstr_) = \
CheckShape<CSOpt::IGNORE_FIRST_DIMS>(ctx, shape_handle, \
__VA_ARGS__); \
if (TF_PREDICT_FALSE(!cs_success_)) { \
return tensorflow::errors::InvalidArgument( \
"invalid shape for '" #shape_handle "', " + cs_errstr_); \
} \
} while (0)
◆ CHECK_SHAPE_HANDLE_IGNORE_LAST_DIMS
#define CHECK_SHAPE_HANDLE_IGNORE_LAST_DIMS |
( |
|
ctx, |
|
|
|
shape_handle, |
|
|
|
... |
|
) |
| |
Value:do { \
bool cs_success_; \
std::string cs_errstr_; \
std::tie(cs_success_, cs_errstr_) = \
CheckShape<CSOpt::IGNORE_LAST_DIMS>(ctx, shape_handle, \
__VA_ARGS__); \
if (TF_PREDICT_FALSE(!cs_success_)) { \
return tensorflow::errors::InvalidArgument( \
"invalid shape for '" #shape_handle "', " + cs_errstr_); \
} \
} while (0)
◆ CHECK_SHAPE_IGNORE_FIRST_DIMS
#define CHECK_SHAPE_IGNORE_FIRST_DIMS |
( |
|
ctx, |
|
|
|
tensor, |
|
|
|
... |
|
) |
| |
Value:do { \
bool cs_success_; \
std::string cs_errstr_; \
std::tie(cs_success_, cs_errstr_) = \
CheckShape<CSOpt::IGNORE_FIRST_DIMS>(tensor, __VA_ARGS__); \
OP_REQUIRES( \
ctx, cs_success_, \
tensorflow::errors::InvalidArgument( \
"invalid shape for '" #tensor "', " + cs_errstr_)); \
} while (0)
◆ CHECK_SHAPE_IGNORE_LAST_DIMS
#define CHECK_SHAPE_IGNORE_LAST_DIMS |
( |
|
ctx, |
|
|
|
tensor, |
|
|
|
... |
|
) |
| |
Value:do { \
bool cs_success_; \
std::string cs_errstr_; \
std::tie(cs_success_, cs_errstr_) = \
CheckShape<CSOpt::IGNORE_LAST_DIMS>(tensor, __VA_ARGS__); \
OP_REQUIRES( \
ctx, cs_success_, \
tensorflow::errors::InvalidArgument( \
"invalid shape for '" #tensor "', " + cs_errstr_)); \
} while (0)
◆ CheckShape() [1/2]
template<open3d::ml::op_util::CSOpt Opt = open3d::ml::op_util::CSOpt::NONE, class TDimX , class... TArgs>
std::tuple<bool, std::string> CheckShape |
( |
::tensorflow::shape_inference::InferenceContext * |
c, |
|
|
::tensorflow::shape_inference::ShapeHandle |
shape_handle, |
|
|
TDimX && |
dimex, |
|
|
TArgs &&... |
args |
|
) |
| |
◆ CheckShape() [2/2]
template<open3d::ml::op_util::CSOpt Opt = open3d::ml::op_util::CSOpt::NONE, class TDimX , class... TArgs>
std::tuple<bool, std::string> CheckShape |
( |
const tensorflow::Tensor & |
tensor, |
|
|
TDimX && |
dimex, |
|
|
TArgs &&... |
args |
|
) |
| |
◆ GetShapeVector() [1/2]
std::vector<open3d::ml::op_util::DimValue> GetShapeVector |
( |
::tensorflow::shape_inference::InferenceContext * |
c, |
|
|
::tensorflow::shape_inference::ShapeHandle |
shape_handle |
|
) |
| |
|
inline |
◆ GetShapeVector() [2/2]
◆ MakeShapeHandle()
template<class TDimX , class... TArgs>
::tensorflow::shape_inference::ShapeHandle MakeShapeHandle |
( |
::tensorflow::shape_inference::InferenceContext * |
ctx, |
|
|
TDimX && |
dimex, |
|
|
TArgs &&... |
args |
|
) |
| |