package tensorboard

  1. Overview
  2. Docs

Source file summary_types.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
[@@@ocaml.warning "-27-30-39"]


type summary_description = {
  type_hint : string;
}

type histogram_proto = {
  min : float;
  max : float;
  num : float;
  sum : float;
  sum_squares : float;
  bucket_limit : float list;
  bucket : float list;
}

type summary_metadata_plugin_data = {
  plugin_name : string;
  content : bytes;
}

type summary_metadata = {
  plugin_data : summary_metadata_plugin_data option;
  display_name : string;
  summary_description : string;
}

type summary_image = {
  height : int32;
  width : int32;
  colorspace : int32;
  encoded_image_string : bytes;
}

type summary_audio = {
  sample_rate : float;
  num_channels : int64;
  length_frames : int64;
  encoded_audio_string : bytes;
  content_type : string;
}

type summary_value_value =
  | Simple_value of float
  | Obsolete_old_style_histogram of bytes
  | Image of summary_image
  | Histo of histogram_proto
  | Audio of summary_audio
  | Tensor of Tensor_types.tensor_proto

and summary_value = {
  node_name : string;
  tag : string;
  metadata : summary_metadata option;
  value : summary_value_value;
}

type summary = {
  value : summary_value list;
}

let rec default_summary_description 
  ?type_hint:((type_hint:string) = "")
  () : summary_description  = {
  type_hint;
}

let rec default_histogram_proto 
  ?min:((min:float) = 0.)
  ?max:((max:float) = 0.)
  ?num:((num:float) = 0.)
  ?sum:((sum:float) = 0.)
  ?sum_squares:((sum_squares:float) = 0.)
  ?bucket_limit:((bucket_limit:float list) = [])
  ?bucket:((bucket:float list) = [])
  () : histogram_proto  = {
  min;
  max;
  num;
  sum;
  sum_squares;
  bucket_limit;
  bucket;
}

let rec default_summary_metadata_plugin_data 
  ?plugin_name:((plugin_name:string) = "")
  ?content:((content:bytes) = Bytes.create 0)
  () : summary_metadata_plugin_data  = {
  plugin_name;
  content;
}

let rec default_summary_metadata 
  ?plugin_data:((plugin_data:summary_metadata_plugin_data option) = None)
  ?display_name:((display_name:string) = "")
  ?summary_description:((summary_description:string) = "")
  () : summary_metadata  = {
  plugin_data;
  display_name;
  summary_description;
}

let rec default_summary_image 
  ?height:((height:int32) = 0l)
  ?width:((width:int32) = 0l)
  ?colorspace:((colorspace:int32) = 0l)
  ?encoded_image_string:((encoded_image_string:bytes) = Bytes.create 0)
  () : summary_image  = {
  height;
  width;
  colorspace;
  encoded_image_string;
}

let rec default_summary_audio 
  ?sample_rate:((sample_rate:float) = 0.)
  ?num_channels:((num_channels:int64) = 0L)
  ?length_frames:((length_frames:int64) = 0L)
  ?encoded_audio_string:((encoded_audio_string:bytes) = Bytes.create 0)
  ?content_type:((content_type:string) = "")
  () : summary_audio  = {
  sample_rate;
  num_channels;
  length_frames;
  encoded_audio_string;
  content_type;
}

let rec default_summary_value_value () : summary_value_value = Simple_value (0.)

and default_summary_value 
  ?node_name:((node_name:string) = "")
  ?tag:((tag:string) = "")
  ?metadata:((metadata:summary_metadata option) = None)
  ?value:((value:summary_value_value) = Simple_value (0.))
  () : summary_value  = {
  node_name;
  tag;
  metadata;
  value;
}

let rec default_summary 
  ?value:((value:summary_value list) = [])
  () : summary  = {
  value;
}