Apply comment suggestions
This commit is contained in:
parent
8c87484fc0
commit
78d22273ad
tensorflow/lite
@ -38,8 +38,9 @@ constexpr int kOutputTensor = 0;
|
||||
TfLiteStatus ResizeOutput(TfLiteContext* context, const TfLiteTensor* input,
|
||||
const TfLiteTensor* axis, TfLiteTensor* output) {
|
||||
int axis_value;
|
||||
// Retrive all 8 bytes when axis type is kTfLiteInt64 to avoid data loss.
|
||||
if (axis->type == kTfLiteInt64) {
|
||||
axis_value = *GetTensorData<int64_t>(axis);
|
||||
axis_value = static_cast<int>(*GetTensorData<int64_t>(axis));
|
||||
} else {
|
||||
axis_value = *GetTensorData<int>(axis);
|
||||
}
|
||||
|
@ -51,7 +51,8 @@ void ReportError(ErrorReporter* error_reporter, const char* format, ...) {
|
||||
}
|
||||
// Returns the int32_t value pointed by ptr.
|
||||
const uint32_t GetIntPtr(const char* ptr) {
|
||||
#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
|
||||
#if defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && \
|
||||
__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
|
||||
return flatbuffers::EndianScalar(*reinterpret_cast<const uint32_t*>(ptr));
|
||||
#else
|
||||
return *reinterpret_cast<const uint32_t*>(ptr);
|
||||
|
Loading…
Reference in New Issue
Block a user