Source code

Revision control

Copy as Markdown

Other Tools

{
"tests": [
{
"name": "reciprocal float32 0D scalar",
"inputs": {
"x": {
"shape": [],
"data": [
-9.363490722293237
],
"type": "float32"
}
},
"expected": {
"name": "output",
"shape": [],
"data": [
-0.10679777711629868
],
"type": "float32"
}
},
{
"name": "reciprocal float32 1D constant tensor",
"inputs": {
"x": {
"shape": [24],
"data": [
-1.011086269320547,
4.6215385203163315,
2.4173768502126727,
-8.934871773645101,
-3.348558485147799,
-8.803302423903414,
8.82632175955639,
6.572828698368518,
6.639494748363678,
2.6842704650429496,
-4.627160556770815,
-6.873653395070409,
-1.185412145486616,
0.9572811852263605,
0.021320551999082227,
0.35645850544829827,
4.827780063442164,
1.312808185701284,
8.246278209083616,
-0.20391698798075097,
-9.039937028172055,
9.94280947774324,
-9.540112102987099,
-0.08022661906399975
],
"type": "float32",
"constant": true
}
},
"expected": {
"name": "output",
"shape": [24],
"data": [
-0.9890353083610535,
0.21637815237045288,
0.4136715531349182,
-0.111921027302742,
-0.29863595962524414,
-0.11359372735023499,
0.1132974773645401,
0.1521414965391159,
0.15061387419700623,
0.3725407123565674,
-0.21611526608467102,
-0.14548304677009583,
-0.8435884118080139,
1.044625163078308,
46.90310287475586,
2.805375576019287,
0.20713452994823456,
0.761725902557373,
0.12126683443784714,
-4.903956413269043,
-0.11062023788690567,
0.10057520121335983,
-0.10482056438922882,
-12.464690208435059
],
"type": "float32"
}
},
{
"name": "reciprocal float32 1D tensor",
"inputs": {
"x": {
"shape": [24],
"data": [
-1.011086269320547,
4.6215385203163315,
2.4173768502126727,
-8.934871773645101,
-3.348558485147799,
-8.803302423903414,
8.82632175955639,
6.572828698368518,
6.639494748363678,
2.6842704650429496,
-4.627160556770815,
-6.873653395070409,
-1.185412145486616,
0.9572811852263605,
0.021320551999082227,
0.35645850544829827,
4.827780063442164,
1.312808185701284,
8.246278209083616,
-0.20391698798075097,
-9.039937028172055,
9.94280947774324,
-9.540112102987099,
-0.08022661906399975
],
"type": "float32"
}
},
"expected": {
"name": "output",
"shape": [24],
"data": [
-0.9890353083610535,
0.21637815237045288,
0.4136715531349182,
-0.111921027302742,
-0.29863595962524414,
-0.11359372735023499,
0.1132974773645401,
0.1521414965391159,
0.15061387419700623,
0.3725407123565674,
-0.21611526608467102,
-0.14548304677009583,
-0.8435884118080139,
1.044625163078308,
46.90310287475586,
2.805375576019287,
0.20713452994823456,
0.761725902557373,
0.12126683443784714,
-4.903956413269043,
-0.11062023788690567,
0.10057520121335983,
-0.10482056438922882,
-12.464690208435059
],
"type": "float32"
}
},
{
"name": "reciprocal float32 2D tensor",
"inputs": {
"x": {
"shape": [4, 6],
"data": [
-1.011086269320547,
4.6215385203163315,
2.4173768502126727,
-8.934871773645101,
-3.348558485147799,
-8.803302423903414,
8.82632175955639,
6.572828698368518,
6.639494748363678,
2.6842704650429496,
-4.627160556770815,
-6.873653395070409,
-1.185412145486616,
0.9572811852263605,
0.021320551999082227,
0.35645850544829827,
4.827780063442164,
1.312808185701284,
8.246278209083616,
-0.20391698798075097,
-9.039937028172055,
9.94280947774324,
-9.540112102987099,
-0.08022661906399975
],
"type": "float32"
}
},
"expected": {
"name": "output",
"shape": [4, 6],
"data": [
-0.9890353083610535,
0.21637815237045288,
0.4136715531349182,
-0.111921027302742,
-0.29863595962524414,
-0.11359372735023499,
0.1132974773645401,
0.1521414965391159,
0.15061387419700623,
0.3725407123565674,
-0.21611526608467102,
-0.14548304677009583,
-0.8435884118080139,
1.044625163078308,
46.90310287475586,
2.805375576019287,
0.20713452994823456,
0.761725902557373,
0.12126683443784714,
-4.903956413269043,
-0.11062023788690567,
0.10057520121335983,
-0.10482056438922882,
-12.464690208435059
],
"type": "float32"
}
},
{
"name": "reciprocal float32 3D tensor",
"inputs": {
"x": {
"shape": [2, 3, 4],
"data": [
-1.011086269320547,
4.6215385203163315,
2.4173768502126727,
-8.934871773645101,
-3.348558485147799,
-8.803302423903414,
8.82632175955639,
6.572828698368518,
6.639494748363678,
2.6842704650429496,
-4.627160556770815,
-6.873653395070409,
-1.185412145486616,
0.9572811852263605,
0.021320551999082227,
0.35645850544829827,
4.827780063442164,
1.312808185701284,
8.246278209083616,
-0.20391698798075097,
-9.039937028172055,
9.94280947774324,
-9.540112102987099,
-0.08022661906399975
],
"type": "float32"
}
},
"expected": {
"name": "output",
"shape": [2, 3, 4],
"data": [
-0.9890353083610535,
0.21637815237045288,
0.4136715531349182,
-0.111921027302742,
-0.29863595962524414,
-0.11359372735023499,
0.1132974773645401,
0.1521414965391159,
0.15061387419700623,
0.3725407123565674,
-0.21611526608467102,
-0.14548304677009583,
-0.8435884118080139,
1.044625163078308,
46.90310287475586,
2.805375576019287,
0.20713452994823456,
0.761725902557373,
0.12126683443784714,
-4.903956413269043,
-0.11062023788690567,
0.10057520121335983,
-0.10482056438922882,
-12.464690208435059
],
"type": "float32"
}
},
{
"name": "reciprocal float32 4D tensor",
"inputs": {
"x": {
"shape": [2, 2, 2, 3],
"data": [
-1.011086269320547,
4.6215385203163315,
2.4173768502126727,
-8.934871773645101,
-3.348558485147799,
-8.803302423903414,
8.82632175955639,
6.572828698368518,
6.639494748363678,
2.6842704650429496,
-4.627160556770815,
-6.873653395070409,
-1.185412145486616,
0.9572811852263605,
0.021320551999082227,
0.35645850544829827,
4.827780063442164,
1.312808185701284,
8.246278209083616,
-0.20391698798075097,
-9.039937028172055,
9.94280947774324,
-9.540112102987099,
-0.08022661906399975
],
"type": "float32"
}
},
"expected": {
"name": "output",
"shape": [2, 2, 2, 3],
"data": [
-0.9890353083610535,
0.21637815237045288,
0.4136715531349182,
-0.111921027302742,
-0.29863595962524414,
-0.11359372735023499,
0.1132974773645401,
0.1521414965391159,
0.15061387419700623,
0.3725407123565674,
-0.21611526608467102,
-0.14548304677009583,
-0.8435884118080139,
1.044625163078308,
46.90310287475586,
2.805375576019287,
0.20713452994823456,
0.761725902557373,
0.12126683443784714,
-4.903956413269043,
-0.11062023788690567,
0.10057520121335983,
-0.10482056438922882,
-12.464690208435059
],
"type": "float32"
}
},
{
"name": "reciprocal float32 5D tensor",
"inputs": {
"x": {
"shape": [2, 1, 4, 1, 3],
"data": [
-1.011086269320547,
4.6215385203163315,
2.4173768502126727,
-8.934871773645101,
-3.348558485147799,
-8.803302423903414,
8.82632175955639,
6.572828698368518,
6.639494748363678,
2.6842704650429496,
-4.627160556770815,
-6.873653395070409,
-1.185412145486616,
0.9572811852263605,
0.021320551999082227,
0.35645850544829827,
4.827780063442164,
1.312808185701284,
8.246278209083616,
-0.20391698798075097,
-9.039937028172055,
9.94280947774324,
-9.540112102987099,
-0.08022661906399975
],
"type": "float32"
}
},
"expected": {
"name": "output",
"shape": [2, 1, 4, 1, 3],
"data": [
-0.9890353083610535,
0.21637815237045288,
0.4136715531349182,
-0.111921027302742,
-0.29863595962524414,
-0.11359372735023499,
0.1132974773645401,
0.1521414965391159,
0.15061387419700623,
0.3725407123565674,
-0.21611526608467102,
-0.14548304677009583,
-0.8435884118080139,
1.044625163078308,
46.90310287475586,
2.805375576019287,
0.20713452994823456,
0.761725902557373,
0.12126683443784714,
-4.903956413269043,
-0.11062023788690567,
0.10057520121335983,
-0.10482056438922882,
-12.464690208435059
],
"type": "float32"
}
}
]
}