Type Benchmark
Namespace tensorflow.test
Parent Benchmark
Interfaces IBenchmark
Abstract class that provides helpers for TensorFlow benchmarks.
Methods
- evaluate
- evaluate
- evaluate
- evaluate_dyn
- is_abstract_dyn<TClass>
- is_abstract<TClass>
- report_benchmark
- report_benchmark
- report_benchmark_dyn
- run_op_benchmark
- run_op_benchmark
- run_op_benchmark
- run_op_benchmark
- run_op_benchmark
- run_op_benchmark
- run_op_benchmark
- run_op_benchmark
- run_op_benchmark
- run_op_benchmark
- run_op_benchmark
- run_op_benchmark
- run_op_benchmark_dyn
Properties
Public instance methods
object evaluate(PythonClassContainer tensors)
Evaluates tensors and returns numpy values.
Parameters
-
PythonClassContainer
tensors - A Tensor or a nested list/tuple of Tensors.
Returns
-
object
- tensors numpy values.
object evaluate(IGraphNodeBase tensors)
Evaluates tensors and returns numpy values.
Parameters
-
IGraphNodeBase
tensors - A Tensor or a nested list/tuple of Tensors.
Returns
-
object
- tensors numpy values.
object evaluate(IEnumerable<object> tensors)
Evaluates tensors and returns numpy values.
Parameters
-
IEnumerable<object>
tensors - A Tensor or a nested list/tuple of Tensors.
Returns
-
object
- tensors numpy values.
object evaluate_dyn(object tensors)
Evaluates tensors and returns numpy values.
Parameters
-
object
tensors - A Tensor or a nested list/tuple of Tensors.
Returns
-
object
- tensors numpy values.
void report_benchmark(Nullable<int> iters, object cpu_time, double wall_time, Nullable<double> throughput, IDictionary<string, object> extras, string name, IEnumerable<IDictionary<string, object>> metrics)
void report_benchmark(Nullable<int> iters, object cpu_time, Nullable<int> wall_time, Nullable<double> throughput, IDictionary<string, object> extras, string name, IEnumerable<IDictionary<string, object>> metrics)
object report_benchmark_dyn(object iters, object cpu_time, object wall_time, object throughput, object extras, object name, object metrics)
IDictionary<string, object> run_op_benchmark(Session sess, IGraphNodeBase op_or_tensor, IDictionary<object, object> feed_dict, int burn_iters, int min_iters, bool store_trace, bool store_memory_usage, string name, IDictionary<string, object> extras, int mbs)
Run an op or tensor in the given session. Report the results.
Parameters
-
Session
sess - `Session` object to use for timing.
-
IGraphNodeBase
op_or_tensor - `Operation` or `Tensor` to benchmark.
-
IDictionary<object, object>
feed_dict - A `dict` of values to feed for each op iteration (see the `feed_dict` parameter of `Session.run`).
-
int
burn_iters - Number of burn-in iterations to run.
-
int
min_iters - Minimum number of iterations to use for timing.
-
bool
store_trace - Boolean, whether to run an extra untimed iteration and store the trace of iteration in returned extras. The trace will be stored as a string in Google Chrome trace format in the extras field "full_trace_chrome_format". Note that trace will not be stored in test_log_pb2.TestResults proto.
-
bool
store_memory_usage - Boolean, whether to run an extra untimed iteration, calculate memory usage, and store that in extras fields.
-
string
name - (optional) Override the BenchmarkEntry name with `name`. Otherwise it is inferred from the top-level method name.
-
IDictionary<string, object>
extras - (optional) Dict mapping string keys to additional benchmark info. Values may be either floats or values that are convertible to strings.
-
int
mbs - (optional) The number of megabytes moved by this op, used to calculate the ops throughput.
Returns
-
IDictionary<string, object>
- A `dict` containing the key-value pairs that were passed to `report_benchmark`. If `store_trace` option is used, then `full_chrome_trace_format` will be included in return dictionary even though it is not passed to `report_benchmark` with `extras`.
IDictionary<string, object> run_op_benchmark(Session sess, IGraphNodeBase op_or_tensor, IDictionary<object, object> feed_dict, int burn_iters, int min_iters, bool store_trace, bool store_memory_usage, ValueTuple<int, int, object> name, IDictionary<string, object> extras, int mbs)
Run an op or tensor in the given session. Report the results.
Parameters
-
Session
sess - `Session` object to use for timing.
-
IGraphNodeBase
op_or_tensor - `Operation` or `Tensor` to benchmark.
-
IDictionary<object, object>
feed_dict - A `dict` of values to feed for each op iteration (see the `feed_dict` parameter of `Session.run`).
-
int
burn_iters - Number of burn-in iterations to run.
-
int
min_iters - Minimum number of iterations to use for timing.
-
bool
store_trace - Boolean, whether to run an extra untimed iteration and store the trace of iteration in returned extras. The trace will be stored as a string in Google Chrome trace format in the extras field "full_trace_chrome_format". Note that trace will not be stored in test_log_pb2.TestResults proto.
-
bool
store_memory_usage - Boolean, whether to run an extra untimed iteration, calculate memory usage, and store that in extras fields.
-
ValueTuple<int, int, object>
name - (optional) Override the BenchmarkEntry name with `name`. Otherwise it is inferred from the top-level method name.
-
IDictionary<string, object>
extras - (optional) Dict mapping string keys to additional benchmark info. Values may be either floats or values that are convertible to strings.
-
int
mbs - (optional) The number of megabytes moved by this op, used to calculate the ops throughput.
Returns
-
IDictionary<string, object>
- A `dict` containing the key-value pairs that were passed to `report_benchmark`. If `store_trace` option is used, then `full_chrome_trace_format` will be included in return dictionary even though it is not passed to `report_benchmark` with `extras`.
IDictionary<string, object> run_op_benchmark(Session sess, object op_or_tensor, IDictionary<object, object> feed_dict, int burn_iters, int min_iters, bool store_trace, bool store_memory_usage, ValueTuple<int, int, object> name, IDictionary<string, object> extras, int mbs)
Run an op or tensor in the given session. Report the results.
Parameters
-
Session
sess - `Session` object to use for timing.
-
object
op_or_tensor - `Operation` or `Tensor` to benchmark.
-
IDictionary<object, object>
feed_dict - A `dict` of values to feed for each op iteration (see the `feed_dict` parameter of `Session.run`).
-
int
burn_iters - Number of burn-in iterations to run.
-
int
min_iters - Minimum number of iterations to use for timing.
-
bool
store_trace - Boolean, whether to run an extra untimed iteration and store the trace of iteration in returned extras. The trace will be stored as a string in Google Chrome trace format in the extras field "full_trace_chrome_format". Note that trace will not be stored in test_log_pb2.TestResults proto.
-
bool
store_memory_usage - Boolean, whether to run an extra untimed iteration, calculate memory usage, and store that in extras fields.
-
ValueTuple<int, int, object>
name - (optional) Override the BenchmarkEntry name with `name`. Otherwise it is inferred from the top-level method name.
-
IDictionary<string, object>
extras - (optional) Dict mapping string keys to additional benchmark info. Values may be either floats or values that are convertible to strings.
-
int
mbs - (optional) The number of megabytes moved by this op, used to calculate the ops throughput.
Returns
-
IDictionary<string, object>
- A `dict` containing the key-value pairs that were passed to `report_benchmark`. If `store_trace` option is used, then `full_chrome_trace_format` will be included in return dictionary even though it is not passed to `report_benchmark` with `extras`.
IDictionary<string, object> run_op_benchmark(Session sess, object op_or_tensor, IDictionary<object, object> feed_dict, int burn_iters, int min_iters, bool store_trace, bool store_memory_usage, ValueTuple<int, object> name, IDictionary<string, object> extras, int mbs)
Run an op or tensor in the given session. Report the results.
Parameters
-
Session
sess - `Session` object to use for timing.
-
object
op_or_tensor - `Operation` or `Tensor` to benchmark.
-
IDictionary<object, object>
feed_dict - A `dict` of values to feed for each op iteration (see the `feed_dict` parameter of `Session.run`).
-
int
burn_iters - Number of burn-in iterations to run.
-
int
min_iters - Minimum number of iterations to use for timing.
-
bool
store_trace - Boolean, whether to run an extra untimed iteration and store the trace of iteration in returned extras. The trace will be stored as a string in Google Chrome trace format in the extras field "full_trace_chrome_format". Note that trace will not be stored in test_log_pb2.TestResults proto.
-
bool
store_memory_usage - Boolean, whether to run an extra untimed iteration, calculate memory usage, and store that in extras fields.
-
ValueTuple<int, object>
name - (optional) Override the BenchmarkEntry name with `name`. Otherwise it is inferred from the top-level method name.
-
IDictionary<string, object>
extras - (optional) Dict mapping string keys to additional benchmark info. Values may be either floats or values that are convertible to strings.
-
int
mbs - (optional) The number of megabytes moved by this op, used to calculate the ops throughput.
Returns
-
IDictionary<string, object>
- A `dict` containing the key-value pairs that were passed to `report_benchmark`. If `store_trace` option is used, then `full_chrome_trace_format` will be included in return dictionary even though it is not passed to `report_benchmark` with `extras`.
IDictionary<string, object> run_op_benchmark(Session sess, object op_or_tensor, IDictionary<object, object> feed_dict, int burn_iters, int min_iters, bool store_trace, bool store_memory_usage, string name, IDictionary<string, object> extras, int mbs)
Run an op or tensor in the given session. Report the results.
Parameters
-
Session
sess - `Session` object to use for timing.
-
object
op_or_tensor - `Operation` or `Tensor` to benchmark.
-
IDictionary<object, object>
feed_dict - A `dict` of values to feed for each op iteration (see the `feed_dict` parameter of `Session.run`).
-
int
burn_iters - Number of burn-in iterations to run.
-
int
min_iters - Minimum number of iterations to use for timing.
-
bool
store_trace - Boolean, whether to run an extra untimed iteration and store the trace of iteration in returned extras. The trace will be stored as a string in Google Chrome trace format in the extras field "full_trace_chrome_format". Note that trace will not be stored in test_log_pb2.TestResults proto.
-
bool
store_memory_usage - Boolean, whether to run an extra untimed iteration, calculate memory usage, and store that in extras fields.
-
string
name - (optional) Override the BenchmarkEntry name with `name`. Otherwise it is inferred from the top-level method name.
-
IDictionary<string, object>
extras - (optional) Dict mapping string keys to additional benchmark info. Values may be either floats or values that are convertible to strings.
-
int
mbs - (optional) The number of megabytes moved by this op, used to calculate the ops throughput.
Returns
-
IDictionary<string, object>
- A `dict` containing the key-value pairs that were passed to `report_benchmark`. If `store_trace` option is used, then `full_chrome_trace_format` will be included in return dictionary even though it is not passed to `report_benchmark` with `extras`.
IDictionary<string, object> run_op_benchmark(Session sess, IGraphNodeBase op_or_tensor, IDictionary<object, object> feed_dict, int burn_iters, int min_iters, bool store_trace, bool store_memory_usage, ValueTuple<int, int, object, object, object, int> name, IDictionary<string, object> extras, int mbs)
Run an op or tensor in the given session. Report the results.
Parameters
-
Session
sess - `Session` object to use for timing.
-
IGraphNodeBase
op_or_tensor - `Operation` or `Tensor` to benchmark.
-
IDictionary<object, object>
feed_dict - A `dict` of values to feed for each op iteration (see the `feed_dict` parameter of `Session.run`).
-
int
burn_iters - Number of burn-in iterations to run.
-
int
min_iters - Minimum number of iterations to use for timing.
-
bool
store_trace - Boolean, whether to run an extra untimed iteration and store the trace of iteration in returned extras. The trace will be stored as a string in Google Chrome trace format in the extras field "full_trace_chrome_format". Note that trace will not be stored in test_log_pb2.TestResults proto.
-
bool
store_memory_usage - Boolean, whether to run an extra untimed iteration, calculate memory usage, and store that in extras fields.
-
ValueTuple<int, int, object, object, object, int>
name - (optional) Override the BenchmarkEntry name with `name`. Otherwise it is inferred from the top-level method name.
-
IDictionary<string, object>
extras - (optional) Dict mapping string keys to additional benchmark info. Values may be either floats or values that are convertible to strings.
-
int
mbs - (optional) The number of megabytes moved by this op, used to calculate the ops throughput.
Returns
-
IDictionary<string, object>
- A `dict` containing the key-value pairs that were passed to `report_benchmark`. If `store_trace` option is used, then `full_chrome_trace_format` will be included in return dictionary even though it is not passed to `report_benchmark` with `extras`.
IDictionary<string, object> run_op_benchmark(Session sess, IEnumerable<object> op_or_tensor, IDictionary<object, object> feed_dict, int burn_iters, int min_iters, bool store_trace, bool store_memory_usage, string name, IDictionary<string, object> extras, int mbs)
Run an op or tensor in the given session. Report the results.
Parameters
-
Session
sess - `Session` object to use for timing.
-
IEnumerable<object>
op_or_tensor - `Operation` or `Tensor` to benchmark.
-
IDictionary<object, object>
feed_dict - A `dict` of values to feed for each op iteration (see the `feed_dict` parameter of `Session.run`).
-
int
burn_iters - Number of burn-in iterations to run.
-
int
min_iters - Minimum number of iterations to use for timing.
-
bool
store_trace - Boolean, whether to run an extra untimed iteration and store the trace of iteration in returned extras. The trace will be stored as a string in Google Chrome trace format in the extras field "full_trace_chrome_format". Note that trace will not be stored in test_log_pb2.TestResults proto.
-
bool
store_memory_usage - Boolean, whether to run an extra untimed iteration, calculate memory usage, and store that in extras fields.
-
string
name - (optional) Override the BenchmarkEntry name with `name`. Otherwise it is inferred from the top-level method name.
-
IDictionary<string, object>
extras - (optional) Dict mapping string keys to additional benchmark info. Values may be either floats or values that are convertible to strings.
-
int
mbs - (optional) The number of megabytes moved by this op, used to calculate the ops throughput.
Returns
-
IDictionary<string, object>
- A `dict` containing the key-value pairs that were passed to `report_benchmark`. If `store_trace` option is used, then `full_chrome_trace_format` will be included in return dictionary even though it is not passed to `report_benchmark` with `extras`.
IDictionary<string, object> run_op_benchmark(Session sess, IEnumerable<object> op_or_tensor, IDictionary<object, object> feed_dict, int burn_iters, int min_iters, bool store_trace, bool store_memory_usage, ValueTuple<int, object> name, IDictionary<string, object> extras, int mbs)
Run an op or tensor in the given session. Report the results.
Parameters
-
Session
sess - `Session` object to use for timing.
-
IEnumerable<object>
op_or_tensor - `Operation` or `Tensor` to benchmark.
-
IDictionary<object, object>
feed_dict - A `dict` of values to feed for each op iteration (see the `feed_dict` parameter of `Session.run`).
-
int
burn_iters - Number of burn-in iterations to run.
-
int
min_iters - Minimum number of iterations to use for timing.
-
bool
store_trace - Boolean, whether to run an extra untimed iteration and store the trace of iteration in returned extras. The trace will be stored as a string in Google Chrome trace format in the extras field "full_trace_chrome_format". Note that trace will not be stored in test_log_pb2.TestResults proto.
-
bool
store_memory_usage - Boolean, whether to run an extra untimed iteration, calculate memory usage, and store that in extras fields.
-
ValueTuple<int, object>
name - (optional) Override the BenchmarkEntry name with `name`. Otherwise it is inferred from the top-level method name.
-
IDictionary<string, object>
extras - (optional) Dict mapping string keys to additional benchmark info. Values may be either floats or values that are convertible to strings.
-
int
mbs - (optional) The number of megabytes moved by this op, used to calculate the ops throughput.
Returns
-
IDictionary<string, object>
- A `dict` containing the key-value pairs that were passed to `report_benchmark`. If `store_trace` option is used, then `full_chrome_trace_format` will be included in return dictionary even though it is not passed to `report_benchmark` with `extras`.
IDictionary<string, object> run_op_benchmark(Session sess, IEnumerable<object> op_or_tensor, IDictionary<object, object> feed_dict, int burn_iters, int min_iters, bool store_trace, bool store_memory_usage, ValueTuple<int, int, object> name, IDictionary<string, object> extras, int mbs)
Run an op or tensor in the given session. Report the results.
Parameters
-
Session
sess - `Session` object to use for timing.
-
IEnumerable<object>
op_or_tensor - `Operation` or `Tensor` to benchmark.
-
IDictionary<object, object>
feed_dict - A `dict` of values to feed for each op iteration (see the `feed_dict` parameter of `Session.run`).
-
int
burn_iters - Number of burn-in iterations to run.
-
int
min_iters - Minimum number of iterations to use for timing.
-
bool
store_trace - Boolean, whether to run an extra untimed iteration and store the trace of iteration in returned extras. The trace will be stored as a string in Google Chrome trace format in the extras field "full_trace_chrome_format". Note that trace will not be stored in test_log_pb2.TestResults proto.
-
bool
store_memory_usage - Boolean, whether to run an extra untimed iteration, calculate memory usage, and store that in extras fields.
-
ValueTuple<int, int, object>
name - (optional) Override the BenchmarkEntry name with `name`. Otherwise it is inferred from the top-level method name.
-
IDictionary<string, object>
extras - (optional) Dict mapping string keys to additional benchmark info. Values may be either floats or values that are convertible to strings.
-
int
mbs - (optional) The number of megabytes moved by this op, used to calculate the ops throughput.
Returns
-
IDictionary<string, object>
- A `dict` containing the key-value pairs that were passed to `report_benchmark`. If `store_trace` option is used, then `full_chrome_trace_format` will be included in return dictionary even though it is not passed to `report_benchmark` with `extras`.
IDictionary<string, object> run_op_benchmark(Session sess, IEnumerable<object> op_or_tensor, IDictionary<object, object> feed_dict, int burn_iters, int min_iters, bool store_trace, bool store_memory_usage, ValueTuple<int, int, object, object, object, int> name, IDictionary<string, object> extras, int mbs)
Run an op or tensor in the given session. Report the results.
Parameters
-
Session
sess - `Session` object to use for timing.
-
IEnumerable<object>
op_or_tensor - `Operation` or `Tensor` to benchmark.
-
IDictionary<object, object>
feed_dict - A `dict` of values to feed for each op iteration (see the `feed_dict` parameter of `Session.run`).
-
int
burn_iters - Number of burn-in iterations to run.
-
int
min_iters - Minimum number of iterations to use for timing.
-
bool
store_trace - Boolean, whether to run an extra untimed iteration and store the trace of iteration in returned extras. The trace will be stored as a string in Google Chrome trace format in the extras field "full_trace_chrome_format". Note that trace will not be stored in test_log_pb2.TestResults proto.
-
bool
store_memory_usage - Boolean, whether to run an extra untimed iteration, calculate memory usage, and store that in extras fields.
-
ValueTuple<int, int, object, object, object, int>
name - (optional) Override the BenchmarkEntry name with `name`. Otherwise it is inferred from the top-level method name.
-
IDictionary<string, object>
extras - (optional) Dict mapping string keys to additional benchmark info. Values may be either floats or values that are convertible to strings.
-
int
mbs - (optional) The number of megabytes moved by this op, used to calculate the ops throughput.
Returns
-
IDictionary<string, object>
- A `dict` containing the key-value pairs that were passed to `report_benchmark`. If `store_trace` option is used, then `full_chrome_trace_format` will be included in return dictionary even though it is not passed to `report_benchmark` with `extras`.
IDictionary<string, object> run_op_benchmark(Session sess, IGraphNodeBase op_or_tensor, IDictionary<object, object> feed_dict, int burn_iters, int min_iters, bool store_trace, bool store_memory_usage, ValueTuple<int, object> name, IDictionary<string, object> extras, int mbs)
Run an op or tensor in the given session. Report the results.
Parameters
-
Session
sess - `Session` object to use for timing.
-
IGraphNodeBase
op_or_tensor - `Operation` or `Tensor` to benchmark.
-
IDictionary<object, object>
feed_dict - A `dict` of values to feed for each op iteration (see the `feed_dict` parameter of `Session.run`).
-
int
burn_iters - Number of burn-in iterations to run.
-
int
min_iters - Minimum number of iterations to use for timing.
-
bool
store_trace - Boolean, whether to run an extra untimed iteration and store the trace of iteration in returned extras. The trace will be stored as a string in Google Chrome trace format in the extras field "full_trace_chrome_format". Note that trace will not be stored in test_log_pb2.TestResults proto.
-
bool
store_memory_usage - Boolean, whether to run an extra untimed iteration, calculate memory usage, and store that in extras fields.
-
ValueTuple<int, object>
name - (optional) Override the BenchmarkEntry name with `name`. Otherwise it is inferred from the top-level method name.
-
IDictionary<string, object>
extras - (optional) Dict mapping string keys to additional benchmark info. Values may be either floats or values that are convertible to strings.
-
int
mbs - (optional) The number of megabytes moved by this op, used to calculate the ops throughput.
Returns
-
IDictionary<string, object>
- A `dict` containing the key-value pairs that were passed to `report_benchmark`. If `store_trace` option is used, then `full_chrome_trace_format` will be included in return dictionary even though it is not passed to `report_benchmark` with `extras`.
IDictionary<string, object> run_op_benchmark(Session sess, object op_or_tensor, IDictionary<object, object> feed_dict, int burn_iters, int min_iters, bool store_trace, bool store_memory_usage, ValueTuple<int, int, object, object, object, int> name, IDictionary<string, object> extras, int mbs)
Run an op or tensor in the given session. Report the results.
Parameters
-
Session
sess - `Session` object to use for timing.
-
object
op_or_tensor - `Operation` or `Tensor` to benchmark.
-
IDictionary<object, object>
feed_dict - A `dict` of values to feed for each op iteration (see the `feed_dict` parameter of `Session.run`).
-
int
burn_iters - Number of burn-in iterations to run.
-
int
min_iters - Minimum number of iterations to use for timing.
-
bool
store_trace - Boolean, whether to run an extra untimed iteration and store the trace of iteration in returned extras. The trace will be stored as a string in Google Chrome trace format in the extras field "full_trace_chrome_format". Note that trace will not be stored in test_log_pb2.TestResults proto.
-
bool
store_memory_usage - Boolean, whether to run an extra untimed iteration, calculate memory usage, and store that in extras fields.
-
ValueTuple<int, int, object, object, object, int>
name - (optional) Override the BenchmarkEntry name with `name`. Otherwise it is inferred from the top-level method name.
-
IDictionary<string, object>
extras - (optional) Dict mapping string keys to additional benchmark info. Values may be either floats or values that are convertible to strings.
-
int
mbs - (optional) The number of megabytes moved by this op, used to calculate the ops throughput.
Returns
-
IDictionary<string, object>
- A `dict` containing the key-value pairs that were passed to `report_benchmark`. If `store_trace` option is used, then `full_chrome_trace_format` will be included in return dictionary even though it is not passed to `report_benchmark` with `extras`.
object run_op_benchmark_dyn(object sess, object op_or_tensor, object feed_dict, ImplicitContainer<T> burn_iters, ImplicitContainer<T> min_iters, ImplicitContainer<T> store_trace, ImplicitContainer<T> store_memory_usage, object name, object extras, ImplicitContainer<T> mbs)
Run an op or tensor in the given session. Report the results.
Parameters
-
object
sess - `Session` object to use for timing.
-
object
op_or_tensor - `Operation` or `Tensor` to benchmark.
-
object
feed_dict - A `dict` of values to feed for each op iteration (see the `feed_dict` parameter of `Session.run`).
-
ImplicitContainer<T>
burn_iters - Number of burn-in iterations to run.
-
ImplicitContainer<T>
min_iters - Minimum number of iterations to use for timing.
-
ImplicitContainer<T>
store_trace - Boolean, whether to run an extra untimed iteration and store the trace of iteration in returned extras. The trace will be stored as a string in Google Chrome trace format in the extras field "full_trace_chrome_format". Note that trace will not be stored in test_log_pb2.TestResults proto.
-
ImplicitContainer<T>
store_memory_usage - Boolean, whether to run an extra untimed iteration, calculate memory usage, and store that in extras fields.
-
object
name - (optional) Override the BenchmarkEntry name with `name`. Otherwise it is inferred from the top-level method name.
-
object
extras - (optional) Dict mapping string keys to additional benchmark info. Values may be either floats or values that are convertible to strings.
-
ImplicitContainer<T>
mbs - (optional) The number of megabytes moved by this op, used to calculate the ops throughput.
Returns
-
object
- A `dict` containing the key-value pairs that were passed to `report_benchmark`. If `store_trace` option is used, then `full_chrome_trace_format` will be included in return dictionary even though it is not passed to `report_benchmark` with `extras`.