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

Function ExampleMulFloat

tensorflow/lite/experimental/ruy/example.cc:21–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19#include "tensorflow/lite/experimental/ruy/ruy.h"
20
21void ExampleMulFloat(ruy::Context *context) {
22 const float lhs_data[] = {1, 2, 3, 4};
23 const float rhs_data[] = {1, 2, 3, 4};
24 float dst_data[4];
25
26 ruy::Matrix<float> lhs;
27 ruy::MakeSimpleLayout(2, 2, ruy::Order::kRowMajor, &lhs.layout);
28 lhs.data = lhs_data;
29 ruy::Matrix<float> rhs;
30 ruy::MakeSimpleLayout(2, 2, ruy::Order::kColMajor, &rhs.layout);
31 rhs.data = rhs_data;
32 ruy::Matrix<float> dst;
33 ruy::MakeSimpleLayout(2, 2, ruy::Order::kColMajor, &dst.layout);
34 dst.data = dst_data;
35
36 ruy::BasicSpec<float, float> spec;
37 ruy::Mul<ruy::kAllPaths>(lhs, rhs, spec, context, &dst);
38
39 std::cout << "Example Mul, float:\n";
40 std::cout << "LHS:\n" << lhs;
41 std::cout << "RHS:\n" << rhs;
42 std::cout << "Result:\n" << dst << "\n";
43}
44
45void ExampleMulFloatWithBiasAddAndClamp(ruy::Context *context) {
46 const float lhs_data[] = {1, 2, 3, 4};

Callers 1

mainFunction · 0.85

Calls 1

MakeSimpleLayoutFunction · 0.85

Tested by

no test coverage detected