objc2_metal_performance_shaders_graph/generated/MPSGraphReductionOps.rs
1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9/// MPSGraphReductionOps.
10#[cfg(all(feature = "MPSGraph", feature = "MPSGraphCore"))]
11impl MPSGraph {
12 extern_methods!(
13 #[cfg(feature = "MPSGraphTensor")]
14 /// Creates a reduction sum operation and returns the result tensor.
15 ///
16 /// - Parameters:
17 /// - tensor: input tensor
18 /// - axis: axis of reduction
19 /// - name: name for the operation
20 /// - Returns: A valid MPSGraphTensor object.
21 #[unsafe(method(reductionSumWithTensor:axis:name:))]
22 #[unsafe(method_family = none)]
23 pub unsafe fn reductionSumWithTensor_axis_name(
24 &self,
25 tensor: &MPSGraphTensor,
26 axis: NSInteger,
27 name: Option<&NSString>,
28 ) -> Retained<MPSGraphTensor>;
29
30 #[cfg(feature = "MPSGraphTensor")]
31 /// Creates a reduction sum operation and returns the result tensor.
32 ///
33 /// - Parameters:
34 /// - tensor: input tensor
35 /// - axes: axes of reduction
36 /// - name: name for the operation
37 /// - Returns: A valid MPSGraphTensor object.
38 #[unsafe(method(reductionSumWithTensor:axes:name:))]
39 #[unsafe(method_family = none)]
40 pub unsafe fn reductionSumWithTensor_axes_name(
41 &self,
42 tensor: &MPSGraphTensor,
43 axes: Option<&NSArray<NSNumber>>,
44 name: Option<&NSString>,
45 ) -> Retained<MPSGraphTensor>;
46
47 #[cfg(feature = "MPSGraphTensor")]
48 /// Creates a reduction max operation and returns the result tensor.
49 ///
50 /// - Parameters:
51 /// - tensor: input tensor
52 /// - axis: axis of reduction
53 /// - name: name for the operation
54 /// - Returns: A valid MPSGraphTensor object.
55 #[unsafe(method(reductionMaximumWithTensor:axis:name:))]
56 #[unsafe(method_family = none)]
57 pub unsafe fn reductionMaximumWithTensor_axis_name(
58 &self,
59 tensor: &MPSGraphTensor,
60 axis: NSInteger,
61 name: Option<&NSString>,
62 ) -> Retained<MPSGraphTensor>;
63
64 #[cfg(feature = "MPSGraphTensor")]
65 /// Creates a reduction max operation and returns the result tensor.
66 ///
67 /// - Parameters:
68 /// - tensor: input tensor
69 /// - axes: axes of reduction
70 /// - name: name for the operation
71 /// - Returns: A valid MPSGraphTensor object.
72 #[unsafe(method(reductionMaximumWithTensor:axes:name:))]
73 #[unsafe(method_family = none)]
74 pub unsafe fn reductionMaximumWithTensor_axes_name(
75 &self,
76 tensor: &MPSGraphTensor,
77 axes: Option<&NSArray<NSNumber>>,
78 name: Option<&NSString>,
79 ) -> Retained<MPSGraphTensor>;
80
81 #[cfg(feature = "MPSGraphTensor")]
82 /// Creates a reduction minimum operation and returns the result tensor.
83 ///
84 /// - Parameters:
85 /// - tensor: input tensor
86 /// - axis: axis of reduction
87 /// - name: name for the operation
88 /// - Returns: A valid MPSGraphTensor object.
89 #[unsafe(method(reductionMinimumWithTensor:axis:name:))]
90 #[unsafe(method_family = none)]
91 pub unsafe fn reductionMinimumWithTensor_axis_name(
92 &self,
93 tensor: &MPSGraphTensor,
94 axis: NSInteger,
95 name: Option<&NSString>,
96 ) -> Retained<MPSGraphTensor>;
97
98 #[cfg(feature = "MPSGraphTensor")]
99 /// Creates a reduction min operation and returns the result tensor.
100 ///
101 /// - Parameters:
102 /// - tensor: input tensor
103 /// - axes: axes of reduction
104 /// - name: name for the operation
105 /// - Returns: A valid MPSGraphTensor object.
106 #[unsafe(method(reductionMinimumWithTensor:axes:name:))]
107 #[unsafe(method_family = none)]
108 pub unsafe fn reductionMinimumWithTensor_axes_name(
109 &self,
110 tensor: &MPSGraphTensor,
111 axes: Option<&NSArray<NSNumber>>,
112 name: Option<&NSString>,
113 ) -> Retained<MPSGraphTensor>;
114
115 #[cfg(feature = "MPSGraphTensor")]
116 /// Creates a reduction max propagate NaN operation and returns the result tensor.
117 ///
118 /// - Parameters:
119 /// - tensor: input tensor
120 /// - axis: axis of reduction
121 /// - name: name for the operation
122 /// - Returns: A valid MPSGraphTensor object.
123 #[unsafe(method(reductionMaximumPropagateNaNWithTensor:axis:name:))]
124 #[unsafe(method_family = none)]
125 pub unsafe fn reductionMaximumPropagateNaNWithTensor_axis_name(
126 &self,
127 tensor: &MPSGraphTensor,
128 axis: NSInteger,
129 name: Option<&NSString>,
130 ) -> Retained<MPSGraphTensor>;
131
132 #[cfg(feature = "MPSGraphTensor")]
133 /// Creates a reduction max propagate NaN operation and returns the result tensor.
134 ///
135 /// - Parameters:
136 /// - tensor: input tensor
137 /// - axes: axes of reduction
138 /// - name: name for the operation
139 /// - Returns: A valid MPSGraphTensor object.
140 #[unsafe(method(reductionMaximumPropagateNaNWithTensor:axes:name:))]
141 #[unsafe(method_family = none)]
142 pub unsafe fn reductionMaximumPropagateNaNWithTensor_axes_name(
143 &self,
144 tensor: &MPSGraphTensor,
145 axes: Option<&NSArray<NSNumber>>,
146 name: Option<&NSString>,
147 ) -> Retained<MPSGraphTensor>;
148
149 #[cfg(feature = "MPSGraphTensor")]
150 /// Creates a reduction min propagate NaN operation and returns the result tensor.
151 ///
152 /// - Parameters:
153 /// - tensor: input tensor
154 /// - axis: axis of reduction
155 /// - name: name for the operation
156 /// - Returns: A valid MPSGraphTensor object.
157 #[unsafe(method(reductionMinimumPropagateNaNWithTensor:axis:name:))]
158 #[unsafe(method_family = none)]
159 pub unsafe fn reductionMinimumPropagateNaNWithTensor_axis_name(
160 &self,
161 tensor: &MPSGraphTensor,
162 axis: NSInteger,
163 name: Option<&NSString>,
164 ) -> Retained<MPSGraphTensor>;
165
166 #[cfg(feature = "MPSGraphTensor")]
167 /// Creates a reduction min propagate NaN operation and returns the result tensor.
168 ///
169 /// - Parameters:
170 /// - tensor: input tensor
171 /// - axes: axes of reduction
172 /// - name: name for the operation
173 /// - Returns: A valid MPSGraphTensor object.
174 #[unsafe(method(reductionMinimumPropagateNaNWithTensor:axes:name:))]
175 #[unsafe(method_family = none)]
176 pub unsafe fn reductionMinimumPropagateNaNWithTensor_axes_name(
177 &self,
178 tensor: &MPSGraphTensor,
179 axes: Option<&NSArray<NSNumber>>,
180 name: Option<&NSString>,
181 ) -> Retained<MPSGraphTensor>;
182
183 #[cfg(feature = "MPSGraphTensor")]
184 /// Creates a reduction product operation and returns the result tensor.
185 ///
186 /// - Parameters:
187 /// - tensor: input tensor
188 /// - axis: axis of reduction
189 /// - name: name for the operation
190 /// - Returns: A valid MPSGraphTensor object.
191 #[unsafe(method(reductionProductWithTensor:axis:name:))]
192 #[unsafe(method_family = none)]
193 pub unsafe fn reductionProductWithTensor_axis_name(
194 &self,
195 tensor: &MPSGraphTensor,
196 axis: NSInteger,
197 name: Option<&NSString>,
198 ) -> Retained<MPSGraphTensor>;
199
200 #[cfg(feature = "MPSGraphTensor")]
201 /// Creates a reduction product operation and returns the result tensor.
202 ///
203 /// - Parameters:
204 /// - tensor: input tensor
205 /// - axes: axes of reduction
206 /// - name: name for the operation
207 /// - Returns: A valid MPSGraphTensor object.
208 #[unsafe(method(reductionProductWithTensor:axes:name:))]
209 #[unsafe(method_family = none)]
210 pub unsafe fn reductionProductWithTensor_axes_name(
211 &self,
212 tensor: &MPSGraphTensor,
213 axes: Option<&NSArray<NSNumber>>,
214 name: Option<&NSString>,
215 ) -> Retained<MPSGraphTensor>;
216
217 #[cfg(feature = "MPSGraphTensor")]
218 /// Creates a reduction argMax operation and returns the result tensor.
219 ///
220 /// - Parameters:
221 /// - tensor: input tensor
222 /// - axis: axis of reduction
223 /// - name: name for the operation
224 /// - Returns: A valid MPSGraphTensor object.
225 #[unsafe(method(reductionArgMaximumWithTensor:axis:name:))]
226 #[unsafe(method_family = none)]
227 pub unsafe fn reductionArgMaximumWithTensor_axis_name(
228 &self,
229 tensor: &MPSGraphTensor,
230 axis: NSInteger,
231 name: Option<&NSString>,
232 ) -> Retained<MPSGraphTensor>;
233
234 #[cfg(feature = "MPSGraphTensor")]
235 /// Creates a reduction argMin operation and returns the result tensor.
236 ///
237 /// - Parameters:
238 /// - tensor: input tensor
239 /// - axis: axis of reduction
240 /// - name: name for the operation
241 /// - Returns: A valid MPSGraphTensor object.
242 #[unsafe(method(reductionArgMinimumWithTensor:axis:name:))]
243 #[unsafe(method_family = none)]
244 pub unsafe fn reductionArgMinimumWithTensor_axis_name(
245 &self,
246 tensor: &MPSGraphTensor,
247 axis: NSInteger,
248 name: Option<&NSString>,
249 ) -> Retained<MPSGraphTensor>;
250
251 #[cfg(feature = "MPSGraphTensor")]
252 /// Creates a reduction and operation and returns the result tensor.
253 ///
254 /// - Parameters:
255 /// - tensor: input tensor
256 /// - axis: axis of reduction
257 /// - name: name for the operation
258 /// - Returns: A valid MPSGraphTensor object.
259 #[unsafe(method(reductionAndWithTensor:axis:name:))]
260 #[unsafe(method_family = none)]
261 pub unsafe fn reductionAndWithTensor_axis_name(
262 &self,
263 tensor: &MPSGraphTensor,
264 axis: NSInteger,
265 name: Option<&NSString>,
266 ) -> Retained<MPSGraphTensor>;
267
268 #[cfg(feature = "MPSGraphTensor")]
269 /// Creates a reduction and operation and returns the result tensor.
270 ///
271 /// - Parameters:
272 /// - tensor: input tensor
273 /// - axes: axes of reduction
274 /// - name: name for the operation
275 /// - Returns: A valid MPSGraphTensor object.
276 #[unsafe(method(reductionAndWithTensor:axes:name:))]
277 #[unsafe(method_family = none)]
278 pub unsafe fn reductionAndWithTensor_axes_name(
279 &self,
280 tensor: &MPSGraphTensor,
281 axes: Option<&NSArray<NSNumber>>,
282 name: Option<&NSString>,
283 ) -> Retained<MPSGraphTensor>;
284
285 #[cfg(feature = "MPSGraphTensor")]
286 /// Creates a reduction or operation and returns the result tensor.
287 ///
288 /// - Parameters:
289 /// - tensor: input tensor
290 /// - axis: axis of reduction
291 /// - name: name for the operation
292 /// - Returns: A valid MPSGraphTensor object.
293 #[unsafe(method(reductionOrWithTensor:axis:name:))]
294 #[unsafe(method_family = none)]
295 pub unsafe fn reductionOrWithTensor_axis_name(
296 &self,
297 tensor: &MPSGraphTensor,
298 axis: NSInteger,
299 name: Option<&NSString>,
300 ) -> Retained<MPSGraphTensor>;
301
302 #[cfg(feature = "MPSGraphTensor")]
303 /// Creates a reduction or operation and returns the result tensor.
304 ///
305 /// - Parameters:
306 /// - tensor: input tensor
307 /// - axes: axes of reduction
308 /// - name: name for the operation
309 /// - Returns: A valid MPSGraphTensor object.
310 #[unsafe(method(reductionOrWithTensor:axes:name:))]
311 #[unsafe(method_family = none)]
312 pub unsafe fn reductionOrWithTensor_axes_name(
313 &self,
314 tensor: &MPSGraphTensor,
315 axes: Option<&NSArray<NSNumber>>,
316 name: Option<&NSString>,
317 ) -> Retained<MPSGraphTensor>;
318 );
319}