Files
pytorch/tools/gen_flatbuffers.sh
Han Qi d555d3f0d0 Update generated header to use flatbuffer v1.12; (#71279)
Summary:
Update generated header to use flatbuffer v1.12;
Also pin flatbuffer repo to v1.12

Pull Request resolved: https://github.com/pytorch/pytorch/pull/71279

Test Plan:
unittest
Fixes #ISSUE_NUMBER

Reviewed By: gmagogsfm

Differential Revision: D33572140

Pulled By: qihqi

fbshipit-source-id: 319efc70f6c491c66a3dfcd7cad1f7defe69916b
2022-01-13 17:23:30 -08:00

16 lines
485 B
Bash

#!/bin/bash
ROOT=$(pwd)
FF_LOCATION="$ROOT/third_party/flatbuffers"
cd "$FF_LOCATION" || exit
mkdir build
cd build || exit
cmake ..
cmake --build . --target flatc
mkdir -p "$ROOT/build/torch/csrc/jit/serialization"
./flatc --cpp --gen-mutable --scoped-enums \
-o "$ROOT/torch/csrc/jit/serialization" \
-c "$ROOT/torch/csrc/jit/serialization/mobile_bytecode.fbs"
echo '// @generated' >> "$ROOT/torch/csrc/jit/serialization/mobile_bytecode_generated.h"
cd "$ROOT" || exit
exit