File tree 5 files changed +54
-2
lines changed
extension/flat_tensor/serialize
5 files changed +54
-2
lines changed Original file line number Diff line number Diff line change
1
+ load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")
2
+ load(":targets.bzl", "define_common_targets")
3
+
4
+ oncall("executorch")
5
+
6
+ define_common_targets()
7
+
8
+ runtime.python_library(
9
+ name = "schema",
10
+ srcs = [
11
+ "flat_tensor_schema.py",
12
+ ],
13
+ visibility = [
14
+ "//executorch/...",
15
+ ],
16
+ )
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ table TensorMetadata {
13
13
scalar_type: executorch_flatbuffer.ScalarType;
14
14
15
15
// Size of each dimension.
16
- dim_sizes : [int32];
16
+ sizes : [int32];
17
17
18
18
// Specifies in what order the dimensions are laid out in memory (from outer
19
19
// to inner).
Original file line number Diff line number Diff line change 17
17
class TensorMetadata :
18
18
fully_qualified_name : str
19
19
scalar_type : ScalarType
20
- dim_sizes : List [int ]
20
+ sizes : List [int ]
21
21
dim_order : List [bytes ]
22
22
23
23
segment_index : int
File renamed without changes.
Original file line number Diff line number Diff line change
1
+ load ("@fbsource//xplat/executorch/build:runtime_wrapper.bzl" , "runtime" )
2
+
3
+ def define_common_targets ():
4
+ runtime .genrule (
5
+ name = "gen_schema" ,
6
+ srcs = [
7
+ "flat_tensor.fbs" ,
8
+ "scalar_type.fbs" ,
9
+ ],
10
+ outs = {
11
+ "schema_generated.h" : ["flat_tensor_generated.h" ],
12
+ "scalar_type_generated.h" : ["scalar_type_generated.h" ]
13
+ },
14
+ cmd = " " .join ([
15
+ "$(exe {})" .format (runtime .external_dep_location ("flatc" )),
16
+ "--cpp" ,
17
+ "--cpp-std c++11" ,
18
+ "--scoped-enums" ,
19
+ "-o ${OUT}" ,
20
+ "${SRCS}" ,
21
+ ]),
22
+ default_outs = ["." ],
23
+ )
24
+
25
+ runtime .cxx_library (
26
+ name = "generated_headers" ,
27
+ srcs = [],
28
+ visibility = [
29
+ "//executorch/..." ,
30
+ ],
31
+ exported_headers = {
32
+ "schema_generated.h" : ":gen_schema[schema_generated.h]" ,
33
+ "scalar_type_generated.h" : ":gen_schema[scalar_type_generated.h]" ,
34
+ },
35
+ exported_external_deps = ["flatbuffers-api" ],
36
+ )
You can’t perform that action at this time.
0 commit comments