Skip to content

Commit

Permalink
model_analyzer: print new line after dump of tensors
Browse files Browse the repository at this point in the history
It looks better for multiple subgraphs models.

example)

Your TFLite model has ‘3’ subgraph(s). In the subgraph description below,
T# represents the Tensor numbers. For example, in Subgraph#0, the WHILE op takes
tensor #1 and tensor #1 and tensor #0 as input and produces tensor #2 and tensor #3 and tensor #4 as output.

Subgraph#0 main(T#0) -> [T#4, T#3]
  Op#0 WHILE(T#1, T#1, T#0) -> [T#2, T#3, T#4]

Tensors of Subgraph#0
  T#0(serving_default_inp:0) shape:[], type:FLOAT32
  T#1(Const) shape:[], type:INT32
  T#2(while) shape:[], type:INT32
  T#3(PartitionedCall:0) shape:[], type:INT32
  T#4(PartitionedCall:1) shape:[], type:FLOAT32

Subgraph#1 while_cond(T#0, T#1, T#2) -> [T#4]
  Op#0 LESS(T#1, T#3) -> [T#4]

Tensors of Subgraph#1
  T#0(arg0) shape:[], type:INT32
  T#1(arg1) shape:[], type:INT32
  T#2(arg2) shape:[], type:FLOAT32
  T#3(while/Less/y) shape:[], type:INT32
  T#4(while/Less) shape:[], type:BOOL

Subgraph#2 while_body(T#0, T#1, T#2) -> [T#7, T#5, T#6]
  Op#0 ADD(T#1, T#3) -> [T#5]
  Op#1 MUL(T#2, T#4) -> [T#6]
  Op#2 ADD(T#0, T#3) -> [T#7]

Tensors of Subgraph#2
  T#0(arg0) shape:[], type:INT32
  T#1(arg1) shape:[], type:INT32
  T#2(arg2) shape:[], type:FLOAT32
  T#3(while/Add/y) shape:[], type:INT32
  T#4(while/scalar_mul/scalar) shape:[], type:FLOAT32
  T#5(while/Add) shape:[], type:INT32
  T#6(while/scalar_mul) shape:[], type:FLOAT32
  T#7(while/add_1) shape:[], type:INT32

PiperOrigin-RevId: 390499926
Change-Id: If2dd3fc5b9f4404c83268d56f3eccb1bc1271d0f
  • Loading branch information
terryheo authored and tensorflower-gardener committed Aug 13, 2021
1 parent ef7b099 commit ed5dd81
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tensorflow/lite/python/analyzer_wrapper/model_analyzer.cc
Expand Up @@ -215,6 +215,7 @@ std::string model_analyzer(const std::string& model_file_or_buffer,
out_stream << " "; // indents for tensors
dump_tensor_detail(out_stream, tensor, j);
}
out_stream << "\n";
}
if (check_gpu_compatibility && model_is_gpu_compatibile) {
out_stream
Expand Down

0 comments on commit ed5dd81

Please sign in to comment.