helper.hpp 1.0 KB

12345678910111213141516171819202122232425262728293031
  1. #ifndef HELPER_FPGA_H
  2. #define HELPER_FPGA_H
  3. #include "tensorflow/core/framework/op.h"
  4. #include "tensorflow/core/framework/shape_inference.h"
  5. #include "tensorflow/core/framework/function.h"
  6. #include "tensorflow/core/util/tensor_format.h"
  7. #include "tensorflow/core/lib/math/math_util.h"
  8. namespace tf_lib {
  9. using namespace tensorflow;
  10. using namespace tensorflow::shape_inference;
  11. typedef Status (*ShapeFunction)(InferenceContext*);
  12. Status DimensionsFromShape(ShapeHandle shape, TensorFormat format,
  13. DimensionHandle* batch_dim,
  14. gtl::MutableArraySlice<DimensionHandle> spatial_dims,
  15. DimensionHandle* filter_dim,
  16. InferenceContext* context);
  17. Status ShapeFromDimensions(DimensionHandle batch_dim,
  18. gtl::ArraySlice<DimensionHandle> spatial_dims,
  19. DimensionHandle filter_dim, TensorFormat format,
  20. InferenceContext* context, ShapeHandle* shape);
  21. }
  22. #endif