Bumps readable file format version for torch.full inferring float from int values (#40089)

Summary:
Reserves file format version 5 for marking when torch.full(int)->FloatTensor will be deprecated.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/40089

Differential Revision: D22066359

Pulled By: mruberry

fbshipit-source-id: 6158e03ca75e3795a2641123ff23d67975170f44
This commit is contained in:
Mike Ruberry
2020-06-16 15:08:01 -07:00
committed by Facebook GitHub Bot
parent b5d54db6f4
commit 3d8de74e17

View File

@@ -91,7 +91,7 @@ namespace caffe2 {
namespace serialize {
constexpr uint64_t kMinSupportedFileFormatVersion = 0x1L;
constexpr uint64_t kMaxSupportedFileFormatVersion = 0x4L;
constexpr uint64_t kMaxSupportedFileFormatVersion = 0x5L;
// Versions (i.e. why was the version number bumped?)
// 1. Initial version
@@ -99,6 +99,8 @@ constexpr uint64_t kMaxSupportedFileFormatVersion = 0x4L;
// 3. Added type tags to pickle serialization of container types
// 4. Stopped integer division using torch.div
// (a versioned symbol preserves the historic behavior of versions 1--3)
// 5. (Read-only) Stops torch.full inferring a floating point dtype
// when given integer fill values.
constexpr uint64_t kProducedFileFormatVersion = 0x4L;
// Writer-specific constants