-
Notifications
You must be signed in to change notification settings - Fork 110
Expand file tree
/
Copy pathaminmax.hpp
More file actions
25 lines (21 loc) · 857 Bytes
/
aminmax.hpp
File metadata and controls
25 lines (21 loc) · 857 Bytes
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
#pragma once
#include "../device.hpp"
#include "common/op.hpp"
#include <optional>
#include <utility>
namespace infinicore::op {
class Aminmax {
public:
using schema = void (*)(Tensor, Tensor, Tensor, std::optional<int64_t>, bool);
static void execute(Tensor min_output, Tensor max_output, Tensor input,
std::optional<int64_t> dim, bool keepdim);
static common::OpDispatcher<schema> &dispatcher();
};
// 返回 (min_tensor, max_tensor) 的 pair
std::pair<Tensor, Tensor> aminmax(Tensor input,
std::optional<int64_t> dim = std::nullopt,
bool keepdim = false);
void aminmax_(Tensor min_output, Tensor max_output, Tensor input,
std::optional<int64_t> dim = std::nullopt,
bool keepdim = false);
} // namespace infinicore::op