MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / af_meanvar

Function af_meanvar

src/api/c/var.cpp:423–493  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

421}
422
423af_err af_meanvar(af_array* mean, af_array* var, const af_array in,
424 const af_array weights, const af_var_bias bias,
425 const dim_t dim) {
426 try {
427 const ArrayInfo& iInfo = getInfo(in);
428 if (weights != 0) {
429 const ArrayInfo& wInfo = getInfo(weights);
430 af_dtype wType = wInfo.getType();
431 ARG_ASSERT(3, (wType == f32 || wType == f64));
432 }
433 af_dtype iType = iInfo.getType();
434
435 switch (iType) {
436 case f32:
437 tie(*mean, *var) =
438 meanvar<float, float>(in, weights, bias, dim);
439 break;
440 case f64:
441 tie(*mean, *var) =
442 meanvar<double, double>(in, weights, bias, dim);
443 break;
444 case s32:
445 tie(*mean, *var) = meanvar<int, float>(in, weights, bias, dim);
446 break;
447 case u32:
448 tie(*mean, *var) = meanvar<uint, float>(in, weights, bias, dim);
449 break;
450 case s16:
451 tie(*mean, *var) =
452 meanvar<short, float>(in, weights, bias, dim);
453 break;
454 case u16:
455 tie(*mean, *var) =
456 meanvar<ushort, float>(in, weights, bias, dim);
457 break;
458 case s64:
459 tie(*mean, *var) =
460 meanvar<intl, double>(in, weights, bias, dim);
461 break;
462 case u64:
463 tie(*mean, *var) =
464 meanvar<uintl, double>(in, weights, bias, dim);
465 break;
466 case s8:
467 tie(*mean, *var) =
468 meanvar<schar, float>(in, weights, bias, dim);
469 break;
470 case u8:
471 tie(*mean, *var) =
472 meanvar<uchar, float>(in, weights, bias, dim);
473 break;
474 case b8:
475 tie(*mean, *var) = meanvar<char, float>(in, weights, bias, dim);
476 break;
477 case c32:
478 tie(*mean, *var) =
479 meanvar<cfloat, cfloat>(in, weights, bias, dim);
480 break;

Callers 2

meanvar_test_functionMethod · 0.50
meanvarFunction · 0.50

Calls 1

getTypeMethod · 0.45

Tested by

no test coverage detected