MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / BM_ImageNetSoftmaxFwd

Function BM_ImageNetSoftmaxFwd

tensorflow/core/kernels/nn_ops_test.cc:1341–1366  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1339BM_Softplus(32, 14, 14, 576, 4, "softplus10");
1340
1341static void BM_ImageNetSoftmaxFwd(int iters, int batch_size, int node_depth,
1342 int num_threads, bool use_gpu,
1343 const string& label) {
1344 auto root = Scope::NewRootScope().ExitOnError();
1345
1346 Tensor input(DT_FLOAT, TensorShape({batch_size, node_depth}));
1347 input.flat<float>().setRandom();
1348
1349 auto softmax = ops::Softmax(root, input);
1350
1351 TF_CHECK_OK(root.status());
1352 Graph* g = new Graph(OpRegistry::Global());
1353 TF_CHECK_OK(root.ToGraph(g));
1354 string device = use_gpu ? "gpu" : "cpu";
1355 SessionOptions opts;
1356 opts.config.set_inter_op_parallelism_threads(1);
1357 opts.config.set_intra_op_parallelism_threads(num_threads);
1358 opts.config.set_use_per_session_threads(true);
1359 opts.config.mutable_graph_options()
1360 ->mutable_optimizer_options()
1361 ->set_opt_level(OptimizerOptions::L0);
1362 testing::UseRealTime();
1363 test::Benchmark(device, g, &opts).Run(iters);
1364 testing::ItemsProcessed(batch_size * node_depth * iters);
1365 testing::SetLabel(label);
1366}
1367
1368#define BM_ImageNetSoftmaxFwd(BATCH_SIZE, NODE_DEPTH, TH, GPU, LABEL) \
1369 static void \

Callers 1

nn_ops_test.ccFile · 0.85

Calls 11

UseRealTimeFunction · 0.85
ItemsProcessedFunction · 0.85
SetLabelFunction · 0.85
ExitOnErrorMethod · 0.80
ToGraphMethod · 0.80
SoftmaxFunction · 0.70
TensorShapeClass · 0.50
BenchmarkClass · 0.50
statusMethod · 0.45
RunMethod · 0.45

Tested by

no test coverage detected