Commit 44774583 authored by Khalique's avatar Khalique
Browse files

formatting

parent ad25a036
......@@ -611,7 +611,7 @@ struct reshape
struct pad
{
std::vector<int64_t> pads;
float value = 0.0f;
float value = 0.0f;
std::string mode = "constant";
template <class Self, class F>
......@@ -632,7 +632,7 @@ struct pad
{
rdims[i] += pads[i] + pads[i + num_dims];
}
shape s{inputs.front().type(), rdims};
return s;
}
......
......@@ -306,16 +306,15 @@ struct cpu_pad
{
assert(output_shape.standard());
argument result{output_shape};
result.visit([&](auto output) {
std::fill(output.begin(), output.end(), op.value);
});
result.visit([&](auto output) { std::fill(output.begin(), output.end(), op.value); });
visit_all(result, args[0])([&](auto output, auto input) {
shape_for_each(output.get_shape(), [&](const auto& idx) {
std::vector<std::size_t> new_idx(idx.size());
std::transform(idx.begin(), idx.end(), op.pads.begin(), new_idx.begin(), [](auto i, auto j) {
return i + j;
});
std::transform(
idx.begin(), idx.end(), op.pads.begin(), new_idx.begin(), [](auto i, auto j) {
return i + j;
});
output(new_idx.begin(), new_idx.end()) = input(idx.begin(), idx.end());
});
});
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment