forked from mindspore-Ecosystem/mindspore
!24654 [MSLITE] rm duplicate func, using nnacl
Merge pull request !24654 from Liu_Xuu/trt_1011_simp
This commit is contained in:
commit
ea4f88cc45
|
@ -1,5 +1,6 @@
|
|||
include_directories(${TENSORRT_PATH}/include)
|
||||
include_directories(${CUDA_PATH}/include)
|
||||
include_directories($(CCSRC_DIR)/backend/kernel_compiler/cpu)
|
||||
file(GLOB_RECURSE TENSORRT_RUNTIME_SRC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/*.cc
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/op/*.cc
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
#include <algorithm>
|
||||
#include "src/delegate/tensorrt/op/resize_tensorrt.h"
|
||||
#include "nnacl/nnacl_common.h"
|
||||
|
||||
namespace mindspore::lite {
|
||||
int ResizeTensorRT::IsSupport(const schema::Primitive *primitive, const std::vector<mindspore::MSTensor> &in_tensors,
|
||||
|
|
|
@ -388,23 +388,4 @@ std::string GetTensorFormat(nvinfer1::ITensor *trt_tensor, mindspore::Format for
|
|||
out_string += dim_string;
|
||||
return out_string;
|
||||
}
|
||||
float ShortToFloat32(uint16_t src_value) {
|
||||
const float32_bits magic = {113 << 23};
|
||||
const unsigned int shifted_exp = 0x7c00 << 13;
|
||||
float32_bits o;
|
||||
|
||||
o.u = (src_value & 0x7fff) << 13;
|
||||
unsigned int exp = shifted_exp & o.u;
|
||||
o.u += (127 - 15) << 23;
|
||||
|
||||
if (exp == shifted_exp) {
|
||||
o.u += (128 - 16) << 23;
|
||||
} else if (exp == 0) {
|
||||
o.u += 1 << 23;
|
||||
o.f -= magic.f;
|
||||
}
|
||||
|
||||
o.u |= (src_value & 0x8000) << 16;
|
||||
return o.f;
|
||||
}
|
||||
} // namespace mindspore::lite
|
||||
|
|
|
@ -84,8 +84,6 @@ void PackNHWCToNCHWFp16(const void *src, void *dst, size_t batch, size_t plane,
|
|||
|
||||
std::string GetTensorFormat(nvinfer1::ITensor *trt_tensor, mindspore::Format format);
|
||||
|
||||
float ShortToFloat32(uint16_t src_value);
|
||||
|
||||
template <typename T1, typename T2>
|
||||
bool SameDims(const std::vector<T1> &shape1, const std::vector<T2> &shape2) {
|
||||
if (shape1.size() != shape2.size()) {
|
||||
|
|
Loading…
Reference in New Issue