cavis/libnd4j/tests_cpu/layers_tests/ReduceTests.cpp

157 lines
108 KiB
C++
Raw Normal View History

2019-06-06 14:21:15 +02:00
/*******************************************************************************
* Copyright (c) 2015-2018 Skymind, Inc.
*
* This program and the accompanying materials are made available under the
* terms of the Apache License, Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* SPDX-License-Identifier: Apache-2.0
******************************************************************************/
//
// Created by agibsonccc on 1/15/17.
//
#include <helpers/ShapeUtils.h>
#include "testinclude.h"
#include <loops/reduce3.h>
#include <loops/reduce_float.h>
#include <array/ArrayOptions.h>
2019-06-06 14:21:15 +02:00
class ReduceTest : public testing::Test {
public:
Nd4jLong shape[2] = {500,3};
float x[1500] = {4.0f, 2.0f, 3.0f, 8.0f, 4.0f, 6.0f, 12.0f, 6.0f, 9.0f, 16.0f, 8.0f, 12.0f, 20.0f, 10.0f, 15.0f, 24.0f, 12.0f, 18.0f, 28.0f, 14.0f, 21.0f, 32.0f, 16.0f, 24.0f, 36.0f, 18.0f, 27.0f, 40.0f, 20.0f, 30.0f, 44.0f, 22.0f, 33.0f, 48.0f, 24.0f, 36.0f, 52.0f, 26.0f, 39.0f, 56.0f, 28.0f, 42.0f, 60.0f, 30.0f, 45.0f, 64.0f, 32.0f, 48.0f, 68.0f, 34.0f, 51.0f, 72.0f, 36.0f, 54.0f, 76.0f, 38.0f, 57.0f, 80.0f, 40.0f, 60.0f, 84.0f, 42.0f, 63.0f, 88.0f, 44.0f, 66.0f, 92.0f, 46.0f, 69.0f, 96.0f, 48.0f, 72.0f, 100.0f, 50.0f, 75.0f, 104.0f, 52.0f, 78.0f, 108.0f, 54.0f, 81.0f, 112.0f, 56.0f, 84.0f, 116.0f, 58.0f, 87.0f, 120.0f, 60.0f, 90.0f, 124.0f, 62.0f, 93.0f, 128.0f, 64.0f, 96.0f, 132.0f, 66.0f, 99.0f, 136.0f, 68.0f, 102.0f, 140.0f, 70.0f, 105.0f, 144.0f, 72.0f, 108.0f, 148.0f, 74.0f, 111.0f, 152.0f, 76.0f, 114.0f, 156.0f, 78.0f, 117.0f, 160.0f, 80.0f, 120.0f, 164.0f, 82.0f, 123.0f, 168.0f, 84.0f, 126.0f, 172.0f, 86.0f, 129.0f, 176.0f, 88.0f, 132.0f, 180.0f, 90.0f, 135.0f, 184.0f, 92.0f, 138.0f, 188.0f, 94.0f, 141.0f, 192.0f, 96.0f, 144.0f, 196.0f, 98.0f, 147.0f, 200.0f, 100.0f, 150.0f, 204.0f, 102.0f, 153.0f, 208.0f, 104.0f, 156.0f, 212.0f, 106.0f, 159.0f, 216.0f, 108.0f, 162.0f, 220.0f, 110.0f, 165.0f, 224.0f, 112.0f, 168.0f, 228.0f, 114.0f, 171.0f, 232.0f, 116.0f, 174.0f, 236.0f, 118.0f, 177.0f, 240.0f, 120.0f, 180.0f, 244.0f, 122.0f, 183.0f, 248.0f, 124.0f, 186.0f, 252.0f, 126.0f, 189.0f, 256.0f, 128.0f, 192.0f, 260.0f, 130.0f, 195.0f, 264.0f, 132.0f, 198.0f, 268.0f, 134.0f, 201.0f, 272.0f, 136.0f, 204.0f, 276.0f, 138.0f, 207.0f, 280.0f, 140.0f, 210.0f, 284.0f, 142.0f, 213.0f, 288.0f, 144.0f, 216.0f, 292.0f, 146.0f, 219.0f, 296.0f, 148.0f, 222.0f, 300.0f, 150.0f, 225.0f, 304.0f, 152.0f, 228.0f, 308.0f, 154.0f, 231.0f, 312.0f, 156.0f, 234.0f, 316.0f, 158.0f, 237.0f, 320.0f, 160.0f, 240.0f, 324.0f, 162.0f, 243.0f, 328.0f, 164.0f, 246.0f, 332.0f, 166.0f, 249.0f, 336.0f, 168.0f, 252.0f, 340.0f, 170.0f, 255.0f, 344.0f, 172.0f, 258.0f, 348.0f, 174.0f, 261.0f, 352.0f, 176.0f, 264.0f, 356.0f, 178.0f, 267.0f, 360.0f, 180.0f, 270.0f, 364.0f, 182.0f, 273.0f, 368.0f, 184.0f, 276.0f, 372.0f, 186.0f, 279.0f, 376.0f, 188.0f, 282.0f, 380.0f, 190.0f, 285.0f, 384.0f, 192.0f, 288.0f, 388.0f, 194.0f, 291.0f, 392.0f, 196.0f, 294.0f, 396.0f, 198.0f, 297.0f, 400.0f, 200.0f, 300.0f, 404.0f, 202.0f, 303.0f, 408.0f, 204.0f, 306.0f, 412.0f, 206.0f, 309.0f, 416.0f, 208.0f, 312.0f, 420.0f, 210.0f, 315.0f, 424.0f, 212.0f, 318.0f, 428.0f, 214.0f, 321.0f, 432.0f, 216.0f, 324.0f, 436.0f, 218.0f, 327.0f, 440.0f, 220.0f, 330.0f, 444.0f, 222.0f, 333.0f, 448.0f, 224.0f, 336.0f, 452.0f, 226.0f, 339.0f, 456.0f, 228.0f, 342.0f, 460.0f, 230.0f, 345.0f, 464.0f, 232.0f, 348.0f, 468.0f, 234.0f, 351.0f, 472.0f, 236.0f, 354.0f, 476.0f, 238.0f, 357.0f, 480.0f, 240.0f, 360.0f, 484.0f, 242.0f, 363.0f, 488.0f, 244.0f, 366.0f, 492.0f, 246.0f, 369.0f, 496.0f, 248.0f, 372.0f, 500.0f, 250.0f, 375.0f, 504.0f, 252.0f, 378.0f, 508.0f, 254.0f, 381.0f, 512.0f, 256.0f, 384.0f, 516.0f, 258.0f, 387.0f, 520.0f, 260.0f, 390.0f, 524.0f, 262.0f, 393.0f, 528.0f, 264.0f, 396.0f, 532.0f, 266.0f, 399.0f, 536.0f, 268.0f, 402.0f, 540.0f, 270.0f, 405.0f, 544.0f, 272.0f, 408.0f, 548.0f, 274.0f, 411.0f, 552.0f, 276.0f, 414.0f, 556.0f, 278.0f, 417.0f, 560.0f, 280.0f, 420.0f, 564.0f, 282.0f, 423.0f, 568.0f, 284.0f, 426.0f, 572.0f, 286.0f, 429.0f, 576.0f, 288.0f, 432.0f, 580.0f, 290.0f, 435.0f, 584.0f, 292.0f, 438.0f, 588.0f, 294.0f, 441.0f, 592.0f, 296.0f, 444.0f, 596.0f, 298.0f, 447.0f, 600.0f, 300.0f, 450.0f, 604.0f, 302.0f, 453.0f, 608.0f, 304.0f, 456.0f, 612.0f, 306.0f, 459.0f, 616.0f, 308.0f, 462.0f, 620.0f, 310.0f, 465.0f, 624.0f, 312.0f, 468.0f, 628.0f, 314.0f, 471.0f, 632.0f, 316.0f, 474.0f, 636.0f, 318.0f, 477.0f, 640.0f, 320.0f, 480.0f, 644.0f, 322.0f, 483.0f, 648.0f, 324.0f, 486.0f, 652.0f, 326.0f, 489.0f, 656.0f, 328.0f, 492.0f, 660.0f, 330.0f, 495.0f, 664.0f, 332.0f, 498.0f, 668.0f, 334.0f, 501.0f, 672.0f, 336.0f, 504.0f, 676.0f, 338.0f, 507.0f, 680.0f, 340.0f, 510.0f, 684.0f, 342.0f, 513.0f, 688.0f, 344.0f, 516.0f, 692.0f, 346.0f, 519.0f, 696.0f, 348.0f, 522.0f, 700.0f, 350.0
float result[1500] = {0.f};
2019-06-06 14:21:15 +02:00
int dimension[1] = {0};
std::vector<int> dim = {0};
int dimensionLength = 1;
float theoreticalMin[3] = {4.f, 2.f, 3.f};
float theoreticalMax[3] = {2000.00f, 1000.00f, 1500.00f};
float theoreticalRange[3] = {1996.00f, 998.00f, 1497.00f};
2019-06-06 14:21:15 +02:00
};
class StdTest : public testing::Test {
public:
Nd4jLong examplesShape[4] = {10,5,10,15};
int dimensionsForStd[3] = {0,2,3};
std::vector<int> dimsForStd = {0,2,3};
int dimensionLength = 3;
//standard deviation
int opNum = 1;
float x[7500] ={0.5786382f, 0.16236664f, 0.069020785f, 0.9840061f, 0.941816f, 0.76720303f, 0.7794372f, 0.46979624f, 0.73381734f, 0.9957244f, 0.6167372f, 0.53088397f, 0.28015637f, 0.826945f, 0.83352476f, 0.66504276f, 0.5793391f, 0.47484478f, 0.7076381f, 0.49456358f, 0.62396896f, 0.53332835f, 0.6388812f, 0.68836075f, 0.26663998f, 0.0014623206f, 0.19409843f, 0.56639415f, 0.98213744f, 0.68497056f, 0.867037f, 0.76840234f, 0.318186f, 0.28759065f, 0.11965875f, 0.53291357f, 0.53767395f, 0.55705845f, 0.7467155f, 0.1575149f, 0.18076386f, 0.8174763f, 0.22883898f, 0.5071535f, 0.86735153f, 0.9635827f, 0.24558435f, 0.15767147f, 0.458882f, 0.71102697f, 0.21914826f, 0.16241662f, 0.27248728f, 0.89015275f, 0.71070856f, 0.55088985f, 0.98992974f, 0.70927286f, 0.9261268f, 0.50781846f, 0.62151235f, 0.4590896f, 0.7487442f, 0.21744072f, 0.2636398f, 0.084352165f, 0.46951914f, 0.383644f, 0.6749645f, 0.24111961f, 0.83259743f, 0.05546627f, 0.4790621f, 0.68884027f, 0.90992177f, 0.23907907f, 0.5342047f, 0.221003f, 0.29615387f, 0.43343517f, 0.16554528f, 0.73144174f, 0.52923626f, 0.10688303f, 0.78197056f, 0.39259177f, 0.43832788f, 0.052234255f, 0.5795483f, 0.97033966f, 0.7392455f, 0.086584255f, 0.9092887f, 0.9402065f, 0.9126419f, 0.44749174f, 0.20514569f, 0.8749829f, 0.30917913f, 0.10170506f, 0.37034252f, 0.7427814f, 0.5497875f, 0.3116048f, 0.12112484f, 0.07918618f, 0.6003074f, 0.6188079f, 0.6292188f, 0.26580265f, 0.42029652f, 0.9863358f, 0.41489154f, 0.23757206f, 0.30395788f, 0.75231904f, 0.76751274f, 0.6324773f, 0.3231405f, 0.5016677f, 0.86029065f, 0.575702f, 0.7473972f, 0.118974194f, 0.115586124f, 0.62481487f, 0.91101325f, 0.6137756f, 0.71462154f, 0.995567f, 0.93439484f, 0.37260458f, 0.6033152f, 0.3444346f, 0.91579247f, 0.7452442f, 0.97466874f, 0.6299154f, 0.35426098f, 0.50121397f, 0.14155711f, 0.78726757f, 0.028531995f, 0.8435531f, 0.6444501f, 0.8826095f, 0.25354537f, 0.5547923f, 0.99555415f, 0.8430975f, 246.29712f, 253.4231f, 282.26755f, 215.6161f, 251.57019f, 239.20515f, 296.2021f, 234.32518f, 278.9852f, 235.4248f, 238.70155f, 256.9956f, 212.62695f, 288.38763f, 231.21237f, 284.80396f, 261.86835f, 223.92522f, 205.86221f, 234.742f, 262.11407f, 298.1942f, 242.60652f, 238.83704f, 251.6588f, 267.23315f, 294.4865f, 223.47488f, 259.24976f, 251.82695f, 265.01166f, 234.65732f, 265.1853f, 202.15352f, 244.42313f, 253.90427f, 212.09233f, 227.62961f, 237.77951f, 261.36838f, 234.32147f, 240.81522f, 273.62595f, 221.19333f, 284.11353f, 216.00859f, 284.36948f, 243.90376f, 282.61584f, 256.97165f, 275.08722f, 253.8055f, 265.1405f, 298.87567f, 223.393f, 288.02148f, 287.26102f, 276.36237f, 290.52777f, 299.57062f, 224.73566f, 290.82623f, 231.3513f, 238.51828f, 230.74028f, 224.97539f, 290.11844f, 238.00816f, 290.39606f, 291.32538f, 272.94766f, 211.88446f, 291.66742f, 210.34077f, 285.62628f, 246.31918f, 283.68738f, 282.34418f, 223.43613f, 245.08679f, 235.22693f, 246.01146f, 224.03375f, 280.5359f, 226.01413f, 262.18884f, 237.87335f, 238.89404f, 259.04294f, 202.59842f, 294.69302f, 209.01956f, 244.75763f, 264.3232f, 293.4627f, 287.69165f, 236.79088f, 282.37012f, 222.24211f, 293.5885f, 249.6388f, 273.91916f, 215.40356f, 255.45584f, 268.4702f, 275.81577f, 259.25064f, 224.95108f, 250.37906f, 267.89093f, 256.31766f, 227.89124f, 204.10915f, 263.38596f, 213.62708f, 218.84116f, 289.00494f, 216.93646f, 200.29439f, 284.1103f, 216.20671f, 260.57642f, 248.57745f, 241.73776f, 244.7205f, 286.86218f, 206.42664f, 204.06395f, 216.60626f, 224.02377f, 219.4697f, 287.2509f, 246.91132f, 289.83777f, 292.73767f, 202.73048f, 206.4165f, 294.0605f, 276.23276f, 288.51318f, 279.45175f, 253.69833f, 281.3311f, 249.44318f, 287.76288f, 262.2878f, 238.2247f, 203.41438f, 208.8359f, 274.0062f, -9.999092f, -9.99934f, -9.999794f, -9.999654f, -9.999987f, -9.999574f, -9.99965f, -9.999892f, -9.999203f, -9.999798f, -9.999658f, -9.999974f, -9.999982f, -9.999003f, -9.999369f, -9.999311f, -9.999708f, -9.999327f, -9.999302f, -9.999419f, -9.999553f, -9.9991665f, -9.999842f, -9.9991665f, -9.999702f, -9.999081f, -9.9993725f, -9.999735f, -9.999399f, -9.999073f, -9.999045f, -9.999458f, -9.99971f, -9.999414f, -9.9991
2019-06-06 14:21:15 +02:00
};
class EuclideanDistanceTest : public testing::Test {
public:
float x[16] = {1.f, 2.f, 3.f, 4.f, 5.f, 6.f, 7.f, 8.f, 1.f, 2.f, 3.f, 4.f, 5.f, 6.f, 7.f, 8.f};
float y[16] = {2.f, 3.f, 4.f, 5.f, 6.f, 7.f, 8.f, 9.f, 2.f, 3.f, 4.f, 5.f, 6.f, 7.f, 8.f, 9.f};
float result[9] = {0.f};
2019-06-06 14:21:15 +02:00
Nd4jLong shapeBuffer[12] = {4,2,2,2,2,8,4,2,1,0,1,99};
int dimensionLength = 3;
int dimension[3] = {1,2,3};
float extraVals[2] = {0.f, 0.f};
2019-06-06 14:21:15 +02:00
int opNum = 1;
std::vector<int> dim = {1, 2, 3};
};
[WIP] multi-device support (#80) * fix pad javadoc and @see links. (#72) Signed-off-by: Robert Altena <Rob@Ra-ai.com> * [WIP] More fixes (#73) * special tests for ConstantTadHelper/ConstantShapeHelper Signed-off-by: raver119 <raver119@gmail.com> * release methods for data buffers Signed-off-by: raver119 <raver119@gmail.com> * delete temporary buffer Java side Signed-off-by: raver119 <raver119@gmail.com> * delete temporary buffer Java side Signed-off-by: raver119 <raver119@gmail.com> * delete temporary TadPack C++/Java side (#74) Signed-off-by: raver119 <raver119@gmail.com> * Zoo model TF import test updates (#75) * argLine fix, update compression_gru comment * updated comment for xception * undid but commented argLine change * updated xlnet comment * copyright headers * - new NDArray methods like()/ulike() (#77) - fix for depthwise_conv2d_bp + special test Signed-off-by: raver119 <raver119@gmail.com> * upsampling2d fix CUDA Signed-off-by: raver119 <raver119@gmail.com> * DL4J trace logging (#79) * MLN/CG trace logging for debugging Signed-off-by: AlexDBlack <blacka101@gmail.com> * Tiny tweak Signed-off-by: AlexDBlack <blacka101@gmail.com> * strided_slice_bp shape fn leak fix Signed-off-by: raver119 <raver119@gmail.com> * SameDiff fixes and naming (#78) * remove SDVariable inplace methods * import methods * npe fix in OpVal * removed SameDiff inplace ops from tests * Naming updates, moved to centralized methods in SameDiff, should use op_#:# for everything * quick fixes * javadoc * SDVariable eval with placeholders * use regex match * better matching * initial commit Signed-off-by: raver119 <raver119@gmail.com> * initial commit Signed-off-by: raver119 <raver119@gmail.com> * fix javadoc. (#76) * fix javadoc. Signed-off-by: Robert Altena <Rob@Ra-ai.com> * replace most @see with @link s. Signed-off-by: Robert Altena <Rob@Ra-ai.com> * 4 additional tests Signed-off-by: raver119 <raver119@gmail.com> * launch context reorganization Signed-off-by: raver119 <raver119@gmail.com> * LaunchContext reorganization Signed-off-by: raver119 <raver119@gmail.com> * per-device LaunchContext Signed-off-by: raver119 <raver119@gmail.com> * Various DL4J/ND4J fixes (#81) * #7954 Force refresh of UI when switching tabs on overview page Signed-off-by: AlexDBlack <blacka101@gmail.com> * #8017 Concurrent modification exception (synchronize) fix Signed-off-by: AlexDBlack <blacka101@gmail.com> * #8033 Don't initialize updater in middle of writing memory crash dump Signed-off-by: AlexDBlack <blacka101@gmail.com> * #8208 Fix shape checks for ND4J int[] creator methods Signed-off-by: AlexDBlack <blacka101@gmail.com> * #6385 #7992 Keras import naming fixes + cleanup Signed-off-by: AlexDBlack <blacka101@gmail.com> * #8016 Upsampling3D - add NDHWC format support Signed-off-by: AlexDBlack <blacka101@gmail.com> * ContextBuffers as separate entity Signed-off-by: raver119 <raver119@gmail.com> * Refactor NativeOps.h to export C functions * Actually export functions from NativeOps.h * Adapt the Java wrappers in ND4J generated with JavaCPP * Create C wrappers for some of the C++ classes currently used by ND4J * ContextBuffers as separate entity Signed-off-by: raver119 <raver119@gmail.com> * remove duplicate code in createBufferDetached. (#83) Signed-off-by: Robert Altena <Rob@Ra-ai.com> * Keras model import - updater lr fix (#84) * Keras model import - updater lr fix Signed-off-by: eraly <susan.eraly@gmail.com> * Keras model import - updater lr fix, cleanup Signed-off-by: eraly <susan.eraly@gmail.com> * ContextBuffers as separate entity Signed-off-by: raver119 <raver119@gmail.com> * ContextBuffers as separate entity Signed-off-by: raver119 <raver119@gmail.com> * Fix functions of OpaqueVariablesSet * thread-local buffers/affinity Signed-off-by: raver119 <raver119@gmail.com> * thread safety for LaunchContext Signed-off-by: raver119 <raver119@gmail.com> * more of thread safety Signed-off-by: raver119 <raver119@gmail.com> * one more multi threaded test Signed-off-by: raver119 <raver119@gmail.com> * SameDiff Convolution Config validation, better output methods (#82) * Conv Config validation & tests Signed-off-by: Ryan Nett <rnett@skymind.io> * stackOutputs utility method Signed-off-by: Ryan Nett <rnett@skymind.io> * use constructor for validation, support negative kernel sizes (infered from weights) Signed-off-by: Ryan Nett <rnett@skymind.io> * better output methods Signed-off-by: Ryan Nett <rnett@skymind.io> * move output to be with fit and evaluate Signed-off-by: Ryan Nett <rnett@skymind.io> * fixes Signed-off-by: Ryan Nett <rnett@skymind.io> * more fixes Signed-off-by: Ryan Nett <rnett@skymind.io> * refactor duplicate code from pad methods. (#86) * refactor duplicate code from pad methods. Signed-off-by: Robert Altena <Rob@Ra-ai.com> * replace switch with if. Signed-off-by: Robert Altena <Rob@Ra-ai.com> * Various ND4J/DL4J fixes and improvements (#87) * Reshape and reallocate - small fixes Signed-off-by: AlexDBlack <blacka101@gmail.com> * Reshape and reallocate - small fixes Signed-off-by: AlexDBlack <blacka101@gmail.com> * #6488 ElementWiseVertex broadcast support Signed-off-by: AlexDBlack <blacka101@gmail.com> * Constructors and broadcast supported it Transforms.max/min Signed-off-by: AlexDBlack <blacka101@gmail.com> * #8054 ElementWiseVertex now supports broadcast inputs Signed-off-by: AlexDBlack <blacka101@gmail.com> * #8057 Nd4j.create overload dtype fix Signed-off-by: AlexDBlack <blacka101@gmail.com> * #7551 ND4J Shape validation fix Signed-off-by: AlexDBlack <blacka101@gmail.com> * [WIP] Numpy boolean import (#91) * numpy bool type Signed-off-by: raver119 <raver119@gmail.com> * numpy bool java side Signed-off-by: raver119 <raver119@gmail.com> * remove create method with unused parameter. (#89) * remove create method with unused parameter. * removed more unused methods. Signed-off-by: Robert Altena <Rob@Ra-ai.com> * removing more unused code. Signed-off-by: Robert Altena <Rob@Ra-ai.com> * last removal of unused code. Signed-off-by: Robert Altena <Rob@Ra-ai.com> * remove createSparse methods. (#92) Signed-off-by: Robert Altena <Rob@Ra-ai.com> * Various ND4J/DL4J fixes (#90) * Deprecate Old*Op instances Signed-off-by: AlexDBlack <blacka101@gmail.com> * #8063 #8054 Broadcast exceptions + cleanup inplace ops Signed-off-by: AlexDBlack <blacka101@gmail.com> * Small fix Signed-off-by: AlexDBlack <blacka101@gmail.com> * Remove bad test condition Signed-off-by: AlexDBlack <blacka101@gmail.com> * #7993 Fix shape function issue in crop_and_resize op Signed-off-by: AlexDBlack <blacka101@gmail.com> * DL4J SameDiff lambda layer fix Signed-off-by: AlexDBlack <blacka101@gmail.com> * #8029 Fix for pnorm backprop math Signed-off-by: AlexDBlack <blacka101@gmail.com> * #8038 Fix Op profiler NaN/Inf triggering + add tests (#93) Signed-off-by: AlexDBlack <blacka101@gmail.com> * createUninitializedDetached refactoring. (#94) * wip * update interface, add null implementations. * Breaking one test in a weird way. Signed-off-by: Robert Altena <Rob@Ra-ai.com> * createUninitializedDetached refactored. Signed-off-by: Robert Altena <Rob@Ra-ai.com> * cuda build fix for issues introduced by recent refactoring Signed-off-by: raver119 <raver119@gmail.com> * [WIP] More of CUDA (#95) * initial commit Signed-off-by: raver119 <raver119@gmail.com> * Implementation of hashcode cuda helper. Working edition. * Fixed parallel test input arangements. * Fixed tests for hashcode op. * Fixed shape calculation for image:crop_and_resize op and test. * NativeOps tests. Initial test suite. * Added tests for indexReduce methods. * Added test on execBroadcast with NDArray as dimensions. * Added test on execBroadcastBool with NDArray as dimensions. * Added tests on execPairwiseTransform and execPairwiseTransofrmBool. * Added tests for execReduce with scalar results. * Added reduce tests for non-empty dims array. * Added tests for reduce3. * Added tests for execScalar. * Added tests for execSummaryStats. * - provide cpu/cuda code for batch_to_space - testing it Signed-off-by: Yurii <yurii@skymind.io> * - remove old test for batch_to_space (had wrong format and numbers were not checked) Signed-off-by: Yurii <yurii@skymind.io> * Fixed complilation errors with test. * Added test for execTransformFloat. * Added test for execTransformSame. * Added test for execTransformBool. * Added test for execTransformStrict. * Added tests for execScalar/execScalarBool with TADs. * Added test for flatten. * - provide cpu/cuda code for space_to_Batch operaion Signed-off-by: Yurii <yurii@skymind.io> * Added test for concat. * comment unnecessary stuff in s_t_b Signed-off-by: Yurii <yurii@skymind.io> * Added test for specialConcat. * Added tests for memcpy/set routines. * Fixed pullRow cuda test. * Added pullRow test. * Added average test. * - correct typo in NDArray::applyPairwiseTransform(nd4j::pairwise::BoolOps op...) Signed-off-by: Yurii <yurii@skymind.io> * - debugging and fixing cuda tests in JavaInteropTests file Signed-off-by: Yurii <yurii@skymind.io> * - correct some tests Signed-off-by: Yurii <yurii@skymind.io> * Added test for shuffle. * Fixed ops declarations. * Restored omp and added shuffle test. * Added convertTypes test. * Added tests for execRandom. Eliminated usage of RandomBuffer with NativeOps. * Added sort tests. * Added tests for execCustomOp. * - further debuging and fixing tests terminated with crash Signed-off-by: Yurii <yurii@skymind.io> * Added tests for calculateOutputShapes. * Addded Benchmarks test. * Commented benchmark tests. * change assertion Signed-off-by: raver119 <raver119@gmail.com> * Added tests for apply_sgd op. Added cpu helper for that op. * Implement cuda helper for aplly_sgd op. Fixed tests for NativeOps. * Added test for assign broadcastable. * Added tests for assign_bp op. * Added tests for axpy op. * - assign/execScalar/execTransformAny signature change - minor test fix Signed-off-by: raver119 <raver119@gmail.com> * Fixed axpy op. * meh Signed-off-by: raver119 <raver119@gmail.com> * - fix tests for nativeOps::concat Signed-off-by: Yurii <yurii@skymind.io> * sequential transform/scalar Signed-off-by: raver119 <raver119@gmail.com> * allow nested parallelism Signed-off-by: raver119 <raver119@gmail.com> * assign_bp leak fix Signed-off-by: raver119 <raver119@gmail.com> * block setRNG fix Signed-off-by: raver119 <raver119@gmail.com> * enable parallelism by default Signed-off-by: raver119 <raver119@gmail.com> * enable nested parallelism by default Signed-off-by: raver119 <raver119@gmail.com> * Added cuda implementation for row_count helper. * Added implementation for tnse gains op helper. * - take into account possible situations when input arrays are empty in reduce_ cuda stuff Signed-off-by: Yurii <yurii@skymind.io> * Implemented tsne/edge_forces op cuda-based helper. Parallelized cpu-based helper for edge_forces. * Added kernel for tsne/symmetrized op heleper. * Implementation of tsne/symmetrized op cuda helper. Working edition. * Eliminated waste printfs. * Added test for broadcastgradientargs op. * host-only fallback for empty reduce float Signed-off-by: raver119 <raver119@gmail.com> * - some tests fixes Signed-off-by: Yurii <yurii@skymind.io> * - correct the rest of reduce_ stuff Signed-off-by: Yurii <yurii@skymind.io> * - further correction of reduce_ stuff Signed-off-by: Yurii <yurii@skymind.io> * Added test for Cbow op. Also added cuda implementation for cbow helpers. * - improve code of stack operation for scalar case Signed-off-by: Yurii <yurii@skymind.io> * - provide cuda kernel for gatherND operation Signed-off-by: Yurii <yurii@skymind.io> * Implementation of cbow helpers with cuda kernels. * minor tests tweaks Signed-off-by: raver119 <raver119@gmail.com> * minor tests tweaks Signed-off-by: raver119 <raver119@gmail.com> * - further correction of cuda stuff Signed-off-by: Yurii <yurii@skymind.io> * Implementatation of cbow op helper with cuda kernels. Working edition. * Skip random testing for cudablas case. * lstmBlockCell context fix Signed-off-by: raver119 <raver119@gmail.com> * Added tests for ELU and ELU_BP ops. * Added tests for eq_scalar, gt_scalar, gte_scalar and lte_scalar ops. * Added tests for neq_scalar. * Added test for noop. * - further work on clipbynorm_bp Signed-off-by: Yurii <yurii@skymind.io> * - get rid of concat op call, use instead direct concat helper call Signed-off-by: Yurii <yurii@skymind.io> * lstmBlockCell context fix Signed-off-by: raver119 <raver119@gmail.com> * Added tests for lrelu and lrelu_bp. * Added tests for selu and selu_bp. * Fixed lrelu derivative helpers. * - some corrections in lstm Signed-off-by: Yurii <yurii@skymind.io> * operator * result shape fix Signed-off-by: raver119 <raver119@gmail.com> * - correct typo in lstmCell Signed-off-by: Yurii <yurii@skymind.io> * few tests fixed Signed-off-by: raver119 <raver119@gmail.com> * CUDA inverse broadcast bool fix Signed-off-by: raver119 <raver119@gmail.com> * disable MMAP test for CUDA Signed-off-by: raver119 <raver119@gmail.com> * BooleanOp syncToDevice Signed-off-by: raver119 <raver119@gmail.com> * meh Signed-off-by: raver119 <raver119@gmail.com> * additional data types for im2col/col2im Signed-off-by: raver119 <raver119@gmail.com> * Added test for firas_sparse op. * one more RandomBuffer test excluded Signed-off-by: raver119 <raver119@gmail.com> * Added tests for flatten op. * Added test for Floor op. * bunch of tests fixed Signed-off-by: raver119 <raver119@gmail.com> * mmulDot tests fixed Signed-off-by: raver119 <raver119@gmail.com> * more tests fixed Signed-off-by: raver119 <raver119@gmail.com> * Implemented floordiv_bp op and tests. * Fixed scalar case with cuda implementation for bds. * - work on cuda kernel for clip_by_norm backprop op is completed Signed-off-by: Yurii <yurii@skymind.io> * Eliminate cbow crach. * more tests fixed Signed-off-by: raver119 <raver119@gmail.com> * more tests fixed Signed-off-by: raver119 <raver119@gmail.com> * Eliminated abortion with batched nlp test. * more tests fixed Signed-off-by: raver119 <raver119@gmail.com> * Fixed shared flag initializing. * disabled bunch of cpu workspaces tests Signed-off-by: raver119 <raver119@gmail.com> * scalar operators fix: missing registerSpecialUse call Signed-off-by: raver119 <raver119@gmail.com> * Fixed logdet for cuda and tests. * - correct clipBynorm_bp Signed-off-by: Yurii <yurii@skymind.io> * Fixed crop_and_resize shape datatype. * - correct some mmul tests Signed-off-by: Yurii <yurii@skymind.io> * build fix Signed-off-by: raver119 <raver119@gmail.com> * exclude two methods for JNI Signed-off-by: raver119 <raver119@gmail.com> * exclude two methods for JNI Signed-off-by: raver119 <raver119@gmail.com> * exclude two methods for JNI (#97) Signed-off-by: raver119 <raver119@gmail.com> * temporary stack fix Signed-off-by: raver119 <raver119@gmail.com> * round robin affinity test Signed-off-by: raver119 <raver119@gmail.com> * get rid of legacy CudaContext methods Signed-off-by: raver119 <raver119@gmail.com> * get rid of legacy ContextPool classes/methods Signed-off-by: raver119 <raver119@gmail.com> * one legacy test removed Signed-off-by: raver119 <raver119@gmail.com> * few more fields rearranged Signed-off-by: raver119 <raver119@gmail.com> * OpaqueLaunchContext Signed-off-by: raver119 <raver119@gmail.com> * OpaqueLaunchContext++ Signed-off-by: raver119 <raver119@gmail.com> * more of OpaqueLaunchContext methods Signed-off-by: raver119 <raver119@gmail.com> * LaunchContext -> CudaContext Signed-off-by: raver119 <raver119@gmail.com> * AffinityManger changes Signed-off-by: raver119 <raver119@gmail.com> * AffinityManger changes Signed-off-by: raver119 <raver119@gmail.com> * cusolver handles Signed-off-by: raver119 <raver119@gmail.com> * typo Signed-off-by: raver119 <raver119@gmail.com> * cusolver method Signed-off-by: raver119 <raver119@gmail.com> * cusolver handle propagated Signed-off-by: raver119 <raver119@gmail.com> * blas/solver handles Signed-off-by: raver119 <raver119@gmail.com> * one more test Signed-off-by: raver119 <raver119@gmail.com> * legacy concat implementations replaced with new CustomOp Signed-off-by: raver119 <raver119@gmail.com> * one more test Signed-off-by: raver119 <raver119@gmail.com> * concat now uses way more blocks Signed-off-by: raver119 <raver119@gmail.com> * print Signed-off-by: raver119 <raver119@gmail.com> * no more triple template mmul Signed-off-by: raver119 <raver119@gmail.com> * bunch of kernels have dtypes reconsidered Signed-off-by: raver119 <raver119@gmail.com> * bunch of kernels have dtypes reconsidered Signed-off-by: raver119 <raver119@gmail.com> * bitonic sort reorganized Signed-off-by: raver119 <raver119@gmail.com> * bunch of cpu stuff removed from cuda scope Signed-off-by: raver119 <raver119@gmail.com> * bunch of cpu stuff removed from cuda scope Signed-off-by: raver119 <raver119@gmail.com> * type conversions moved to generic impl Signed-off-by: raver119 <raver119@gmail.com> * cpu data types pass Signed-off-by: raver119 <raver119@gmail.com> * non_max_suppression Signed-off-by: raver119 <raver119@gmail.com> * sortByValue fix Signed-off-by: raver119 <raver119@gmail.com> * ignore all mixed datatype tests for mmul Signed-off-by: raver119 <raver119@gmail.com> * special handling of OpProfiler exceptions Signed-off-by: raver119 <raver119@gmail.com> * - one failing concat test in cpp - Nd4j.tile now uses op internally Signed-off-by: raver119 <raver119@gmail.com> * get back dtype exception for legacy arrays deserialization Signed-off-by: raver119 <raver119@gmail.com>
2019-08-14 15:52:34 +02:00
#ifndef __CUDABLAS__
2019-06-06 14:21:15 +02:00
TEST_F(EuclideanDistanceTest,Test1) {
//int *tadShapeBuffer = shape::computeResultShape(shapeBuffer,dimension,dimensionLength);
sd::ArrayOptions::setDataType(shapeBuffer, sd::DataType::FLOAT32);
auto tadShapeBuffer = sd::ShapeUtils::evalReduceShapeInfo('c', dim, shapeBuffer, false, true, nullptr);
2019-06-06 14:21:15 +02:00
//shape::printShapeInfoLinear("tadShape", tadShapeBuffer);
functions::reduce3::Reduce3<float, float>::exec(opNum,
x,
shapeBuffer,
extraVals,
y,
shapeBuffer,
result,
tadShapeBuffer,
dimension,
dimensionLength, 0, 2);
2019-06-06 14:21:15 +02:00
ASSERT_EQ(result[1],result[0]);
}
TEST_F(StdTest,MultiDimTest) {
auto xShapeInfo = shape::shapeBuffer(4, sd::DataType::FLOAT32, examplesShape);
2019-06-06 14:21:15 +02:00
//int *resultShapeInfo = shape::computeResultShape(xShapeInfo,dimensionsForStd,dimensionLength);
auto resultShapeInfo = sd::ShapeUtils::evalReduceShapeInfo('c', dimsForStd, xShapeInfo, false, true, nullptr);
2019-06-06 14:21:15 +02:00
int resultLengthAssertion = 5;
ASSERT_EQ(resultLengthAssertion,shape::length(resultShapeInfo));
shape::TAD *tad = new shape::TAD;
tad->init(xShapeInfo,dimensionsForStd,dimensionLength);
float none[1] = {0.f};
2019-06-06 14:21:15 +02:00
tad->createTadOnlyShapeInfo();
tad->createOffsets();
int tadElementWiseStride = shape::elementWiseStride(tad->tadOnlyShapeInfo);
ASSERT_EQ(0,tadElementWiseStride);
float *result = new float[shape::length(resultShapeInfo)];
functions::reduce::ReduceFloatFunction<float,float>::exec(
opNum,
x,
xShapeInfo,
none,
result,
resultShapeInfo,
dimensionsForStd,
dimensionLength,
tad->tadOnlyShapeInfo,
tad->tadOffsets, 0, shape::length(resultShapeInfo));
2019-06-06 14:21:15 +02:00
// for(int i = 0; i < shape::length(resultShapeInfo); i++)
// printf("%f\n",result[i]);
delete[] result;
delete tad;
delete[] xShapeInfo;
}
TEST_F(ReduceTest,MatrixTest) {
int opNum = 4;
auto xShapeInfo = sd::ShapeBuilders::createShapeInfo(sd::DataType::FLOAT32, 'c', 2, shape);
2019-06-06 14:21:15 +02:00
//int *resultShapeInfo = shape::computeResultShape(xShapeInfo,dimension,dimensionLength);
auto resultShapeInfo = sd::ShapeUtils::evalReduceShapeInfo('c', dim, xShapeInfo, false, true, nullptr);
2019-06-06 14:21:15 +02:00
int resultLengthAssertion = 3;
ASSERT_EQ(resultLengthAssertion,shape::length(resultShapeInfo));
shape::TAD *tad = new shape::TAD;
tad->init(xShapeInfo,dimension,dimensionLength);
float none[1] = {0.f};
2019-06-06 14:21:15 +02:00
tad->createTadOnlyShapeInfo();
tad->createOffsets();
auto tadElementWiseStride = shape::elementWiseStride(tad->tadOnlyShapeInfo);
ASSERT_EQ(3,tadElementWiseStride);
functions::reduce::ReduceFloatFunction<float,float>::exec(
opNum,
x,
xShapeInfo,
none,
result,
resultShapeInfo,
dimension,
dimensionLength,
tad->tadOnlyShapeInfo,
tad->tadOffsets, 0, tad->numTads);
2019-06-06 14:21:15 +02:00
// for(int i = 0; i < shape::length(resultShapeInfo); i++)
// printf("%f\n",result[i]);
delete tad;
delete[] xShapeInfo;
[WIP] multi-device support (#80) * fix pad javadoc and @see links. (#72) Signed-off-by: Robert Altena <Rob@Ra-ai.com> * [WIP] More fixes (#73) * special tests for ConstantTadHelper/ConstantShapeHelper Signed-off-by: raver119 <raver119@gmail.com> * release methods for data buffers Signed-off-by: raver119 <raver119@gmail.com> * delete temporary buffer Java side Signed-off-by: raver119 <raver119@gmail.com> * delete temporary buffer Java side Signed-off-by: raver119 <raver119@gmail.com> * delete temporary TadPack C++/Java side (#74) Signed-off-by: raver119 <raver119@gmail.com> * Zoo model TF import test updates (#75) * argLine fix, update compression_gru comment * updated comment for xception * undid but commented argLine change * updated xlnet comment * copyright headers * - new NDArray methods like()/ulike() (#77) - fix for depthwise_conv2d_bp + special test Signed-off-by: raver119 <raver119@gmail.com> * upsampling2d fix CUDA Signed-off-by: raver119 <raver119@gmail.com> * DL4J trace logging (#79) * MLN/CG trace logging for debugging Signed-off-by: AlexDBlack <blacka101@gmail.com> * Tiny tweak Signed-off-by: AlexDBlack <blacka101@gmail.com> * strided_slice_bp shape fn leak fix Signed-off-by: raver119 <raver119@gmail.com> * SameDiff fixes and naming (#78) * remove SDVariable inplace methods * import methods * npe fix in OpVal * removed SameDiff inplace ops from tests * Naming updates, moved to centralized methods in SameDiff, should use op_#:# for everything * quick fixes * javadoc * SDVariable eval with placeholders * use regex match * better matching * initial commit Signed-off-by: raver119 <raver119@gmail.com> * initial commit Signed-off-by: raver119 <raver119@gmail.com> * fix javadoc. (#76) * fix javadoc. Signed-off-by: Robert Altena <Rob@Ra-ai.com> * replace most @see with @link s. Signed-off-by: Robert Altena <Rob@Ra-ai.com> * 4 additional tests Signed-off-by: raver119 <raver119@gmail.com> * launch context reorganization Signed-off-by: raver119 <raver119@gmail.com> * LaunchContext reorganization Signed-off-by: raver119 <raver119@gmail.com> * per-device LaunchContext Signed-off-by: raver119 <raver119@gmail.com> * Various DL4J/ND4J fixes (#81) * #7954 Force refresh of UI when switching tabs on overview page Signed-off-by: AlexDBlack <blacka101@gmail.com> * #8017 Concurrent modification exception (synchronize) fix Signed-off-by: AlexDBlack <blacka101@gmail.com> * #8033 Don't initialize updater in middle of writing memory crash dump Signed-off-by: AlexDBlack <blacka101@gmail.com> * #8208 Fix shape checks for ND4J int[] creator methods Signed-off-by: AlexDBlack <blacka101@gmail.com> * #6385 #7992 Keras import naming fixes + cleanup Signed-off-by: AlexDBlack <blacka101@gmail.com> * #8016 Upsampling3D - add NDHWC format support Signed-off-by: AlexDBlack <blacka101@gmail.com> * ContextBuffers as separate entity Signed-off-by: raver119 <raver119@gmail.com> * Refactor NativeOps.h to export C functions * Actually export functions from NativeOps.h * Adapt the Java wrappers in ND4J generated with JavaCPP * Create C wrappers for some of the C++ classes currently used by ND4J * ContextBuffers as separate entity Signed-off-by: raver119 <raver119@gmail.com> * remove duplicate code in createBufferDetached. (#83) Signed-off-by: Robert Altena <Rob@Ra-ai.com> * Keras model import - updater lr fix (#84) * Keras model import - updater lr fix Signed-off-by: eraly <susan.eraly@gmail.com> * Keras model import - updater lr fix, cleanup Signed-off-by: eraly <susan.eraly@gmail.com> * ContextBuffers as separate entity Signed-off-by: raver119 <raver119@gmail.com> * ContextBuffers as separate entity Signed-off-by: raver119 <raver119@gmail.com> * Fix functions of OpaqueVariablesSet * thread-local buffers/affinity Signed-off-by: raver119 <raver119@gmail.com> * thread safety for LaunchContext Signed-off-by: raver119 <raver119@gmail.com> * more of thread safety Signed-off-by: raver119 <raver119@gmail.com> * one more multi threaded test Signed-off-by: raver119 <raver119@gmail.com> * SameDiff Convolution Config validation, better output methods (#82) * Conv Config validation & tests Signed-off-by: Ryan Nett <rnett@skymind.io> * stackOutputs utility method Signed-off-by: Ryan Nett <rnett@skymind.io> * use constructor for validation, support negative kernel sizes (infered from weights) Signed-off-by: Ryan Nett <rnett@skymind.io> * better output methods Signed-off-by: Ryan Nett <rnett@skymind.io> * move output to be with fit and evaluate Signed-off-by: Ryan Nett <rnett@skymind.io> * fixes Signed-off-by: Ryan Nett <rnett@skymind.io> * more fixes Signed-off-by: Ryan Nett <rnett@skymind.io> * refactor duplicate code from pad methods. (#86) * refactor duplicate code from pad methods. Signed-off-by: Robert Altena <Rob@Ra-ai.com> * replace switch with if. Signed-off-by: Robert Altena <Rob@Ra-ai.com> * Various ND4J/DL4J fixes and improvements (#87) * Reshape and reallocate - small fixes Signed-off-by: AlexDBlack <blacka101@gmail.com> * Reshape and reallocate - small fixes Signed-off-by: AlexDBlack <blacka101@gmail.com> * #6488 ElementWiseVertex broadcast support Signed-off-by: AlexDBlack <blacka101@gmail.com> * Constructors and broadcast supported it Transforms.max/min Signed-off-by: AlexDBlack <blacka101@gmail.com> * #8054 ElementWiseVertex now supports broadcast inputs Signed-off-by: AlexDBlack <blacka101@gmail.com> * #8057 Nd4j.create overload dtype fix Signed-off-by: AlexDBlack <blacka101@gmail.com> * #7551 ND4J Shape validation fix Signed-off-by: AlexDBlack <blacka101@gmail.com> * [WIP] Numpy boolean import (#91) * numpy bool type Signed-off-by: raver119 <raver119@gmail.com> * numpy bool java side Signed-off-by: raver119 <raver119@gmail.com> * remove create method with unused parameter. (#89) * remove create method with unused parameter. * removed more unused methods. Signed-off-by: Robert Altena <Rob@Ra-ai.com> * removing more unused code. Signed-off-by: Robert Altena <Rob@Ra-ai.com> * last removal of unused code. Signed-off-by: Robert Altena <Rob@Ra-ai.com> * remove createSparse methods. (#92) Signed-off-by: Robert Altena <Rob@Ra-ai.com> * Various ND4J/DL4J fixes (#90) * Deprecate Old*Op instances Signed-off-by: AlexDBlack <blacka101@gmail.com> * #8063 #8054 Broadcast exceptions + cleanup inplace ops Signed-off-by: AlexDBlack <blacka101@gmail.com> * Small fix Signed-off-by: AlexDBlack <blacka101@gmail.com> * Remove bad test condition Signed-off-by: AlexDBlack <blacka101@gmail.com> * #7993 Fix shape function issue in crop_and_resize op Signed-off-by: AlexDBlack <blacka101@gmail.com> * DL4J SameDiff lambda layer fix Signed-off-by: AlexDBlack <blacka101@gmail.com> * #8029 Fix for pnorm backprop math Signed-off-by: AlexDBlack <blacka101@gmail.com> * #8038 Fix Op profiler NaN/Inf triggering + add tests (#93) Signed-off-by: AlexDBlack <blacka101@gmail.com> * createUninitializedDetached refactoring. (#94) * wip * update interface, add null implementations. * Breaking one test in a weird way. Signed-off-by: Robert Altena <Rob@Ra-ai.com> * createUninitializedDetached refactored. Signed-off-by: Robert Altena <Rob@Ra-ai.com> * cuda build fix for issues introduced by recent refactoring Signed-off-by: raver119 <raver119@gmail.com> * [WIP] More of CUDA (#95) * initial commit Signed-off-by: raver119 <raver119@gmail.com> * Implementation of hashcode cuda helper. Working edition. * Fixed parallel test input arangements. * Fixed tests for hashcode op. * Fixed shape calculation for image:crop_and_resize op and test. * NativeOps tests. Initial test suite. * Added tests for indexReduce methods. * Added test on execBroadcast with NDArray as dimensions. * Added test on execBroadcastBool with NDArray as dimensions. * Added tests on execPairwiseTransform and execPairwiseTransofrmBool. * Added tests for execReduce with scalar results. * Added reduce tests for non-empty dims array. * Added tests for reduce3. * Added tests for execScalar. * Added tests for execSummaryStats. * - provide cpu/cuda code for batch_to_space - testing it Signed-off-by: Yurii <yurii@skymind.io> * - remove old test for batch_to_space (had wrong format and numbers were not checked) Signed-off-by: Yurii <yurii@skymind.io> * Fixed complilation errors with test. * Added test for execTransformFloat. * Added test for execTransformSame. * Added test for execTransformBool. * Added test for execTransformStrict. * Added tests for execScalar/execScalarBool with TADs. * Added test for flatten. * - provide cpu/cuda code for space_to_Batch operaion Signed-off-by: Yurii <yurii@skymind.io> * Added test for concat. * comment unnecessary stuff in s_t_b Signed-off-by: Yurii <yurii@skymind.io> * Added test for specialConcat. * Added tests for memcpy/set routines. * Fixed pullRow cuda test. * Added pullRow test. * Added average test. * - correct typo in NDArray::applyPairwiseTransform(nd4j::pairwise::BoolOps op...) Signed-off-by: Yurii <yurii@skymind.io> * - debugging and fixing cuda tests in JavaInteropTests file Signed-off-by: Yurii <yurii@skymind.io> * - correct some tests Signed-off-by: Yurii <yurii@skymind.io> * Added test for shuffle. * Fixed ops declarations. * Restored omp and added shuffle test. * Added convertTypes test. * Added tests for execRandom. Eliminated usage of RandomBuffer with NativeOps. * Added sort tests. * Added tests for execCustomOp. * - further debuging and fixing tests terminated with crash Signed-off-by: Yurii <yurii@skymind.io> * Added tests for calculateOutputShapes. * Addded Benchmarks test. * Commented benchmark tests. * change assertion Signed-off-by: raver119 <raver119@gmail.com> * Added tests for apply_sgd op. Added cpu helper for that op. * Implement cuda helper for aplly_sgd op. Fixed tests for NativeOps. * Added test for assign broadcastable. * Added tests for assign_bp op. * Added tests for axpy op. * - assign/execScalar/execTransformAny signature change - minor test fix Signed-off-by: raver119 <raver119@gmail.com> * Fixed axpy op. * meh Signed-off-by: raver119 <raver119@gmail.com> * - fix tests for nativeOps::concat Signed-off-by: Yurii <yurii@skymind.io> * sequential transform/scalar Signed-off-by: raver119 <raver119@gmail.com> * allow nested parallelism Signed-off-by: raver119 <raver119@gmail.com> * assign_bp leak fix Signed-off-by: raver119 <raver119@gmail.com> * block setRNG fix Signed-off-by: raver119 <raver119@gmail.com> * enable parallelism by default Signed-off-by: raver119 <raver119@gmail.com> * enable nested parallelism by default Signed-off-by: raver119 <raver119@gmail.com> * Added cuda implementation for row_count helper. * Added implementation for tnse gains op helper. * - take into account possible situations when input arrays are empty in reduce_ cuda stuff Signed-off-by: Yurii <yurii@skymind.io> * Implemented tsne/edge_forces op cuda-based helper. Parallelized cpu-based helper for edge_forces. * Added kernel for tsne/symmetrized op heleper. * Implementation of tsne/symmetrized op cuda helper. Working edition. * Eliminated waste printfs. * Added test for broadcastgradientargs op. * host-only fallback for empty reduce float Signed-off-by: raver119 <raver119@gmail.com> * - some tests fixes Signed-off-by: Yurii <yurii@skymind.io> * - correct the rest of reduce_ stuff Signed-off-by: Yurii <yurii@skymind.io> * - further correction of reduce_ stuff Signed-off-by: Yurii <yurii@skymind.io> * Added test for Cbow op. Also added cuda implementation for cbow helpers. * - improve code of stack operation for scalar case Signed-off-by: Yurii <yurii@skymind.io> * - provide cuda kernel for gatherND operation Signed-off-by: Yurii <yurii@skymind.io> * Implementation of cbow helpers with cuda kernels. * minor tests tweaks Signed-off-by: raver119 <raver119@gmail.com> * minor tests tweaks Signed-off-by: raver119 <raver119@gmail.com> * - further correction of cuda stuff Signed-off-by: Yurii <yurii@skymind.io> * Implementatation of cbow op helper with cuda kernels. Working edition. * Skip random testing for cudablas case. * lstmBlockCell context fix Signed-off-by: raver119 <raver119@gmail.com> * Added tests for ELU and ELU_BP ops. * Added tests for eq_scalar, gt_scalar, gte_scalar and lte_scalar ops. * Added tests for neq_scalar. * Added test for noop. * - further work on clipbynorm_bp Signed-off-by: Yurii <yurii@skymind.io> * - get rid of concat op call, use instead direct concat helper call Signed-off-by: Yurii <yurii@skymind.io> * lstmBlockCell context fix Signed-off-by: raver119 <raver119@gmail.com> * Added tests for lrelu and lrelu_bp. * Added tests for selu and selu_bp. * Fixed lrelu derivative helpers. * - some corrections in lstm Signed-off-by: Yurii <yurii@skymind.io> * operator * result shape fix Signed-off-by: raver119 <raver119@gmail.com> * - correct typo in lstmCell Signed-off-by: Yurii <yurii@skymind.io> * few tests fixed Signed-off-by: raver119 <raver119@gmail.com> * CUDA inverse broadcast bool fix Signed-off-by: raver119 <raver119@gmail.com> * disable MMAP test for CUDA Signed-off-by: raver119 <raver119@gmail.com> * BooleanOp syncToDevice Signed-off-by: raver119 <raver119@gmail.com> * meh Signed-off-by: raver119 <raver119@gmail.com> * additional data types for im2col/col2im Signed-off-by: raver119 <raver119@gmail.com> * Added test for firas_sparse op. * one more RandomBuffer test excluded Signed-off-by: raver119 <raver119@gmail.com> * Added tests for flatten op. * Added test for Floor op. * bunch of tests fixed Signed-off-by: raver119 <raver119@gmail.com> * mmulDot tests fixed Signed-off-by: raver119 <raver119@gmail.com> * more tests fixed Signed-off-by: raver119 <raver119@gmail.com> * Implemented floordiv_bp op and tests. * Fixed scalar case with cuda implementation for bds. * - work on cuda kernel for clip_by_norm backprop op is completed Signed-off-by: Yurii <yurii@skymind.io> * Eliminate cbow crach. * more tests fixed Signed-off-by: raver119 <raver119@gmail.com> * more tests fixed Signed-off-by: raver119 <raver119@gmail.com> * Eliminated abortion with batched nlp test. * more tests fixed Signed-off-by: raver119 <raver119@gmail.com> * Fixed shared flag initializing. * disabled bunch of cpu workspaces tests Signed-off-by: raver119 <raver119@gmail.com> * scalar operators fix: missing registerSpecialUse call Signed-off-by: raver119 <raver119@gmail.com> * Fixed logdet for cuda and tests. * - correct clipBynorm_bp Signed-off-by: Yurii <yurii@skymind.io> * Fixed crop_and_resize shape datatype. * - correct some mmul tests Signed-off-by: Yurii <yurii@skymind.io> * build fix Signed-off-by: raver119 <raver119@gmail.com> * exclude two methods for JNI Signed-off-by: raver119 <raver119@gmail.com> * exclude two methods for JNI Signed-off-by: raver119 <raver119@gmail.com> * exclude two methods for JNI (#97) Signed-off-by: raver119 <raver119@gmail.com> * temporary stack fix Signed-off-by: raver119 <raver119@gmail.com> * round robin affinity test Signed-off-by: raver119 <raver119@gmail.com> * get rid of legacy CudaContext methods Signed-off-by: raver119 <raver119@gmail.com> * get rid of legacy ContextPool classes/methods Signed-off-by: raver119 <raver119@gmail.com> * one legacy test removed Signed-off-by: raver119 <raver119@gmail.com> * few more fields rearranged Signed-off-by: raver119 <raver119@gmail.com> * OpaqueLaunchContext Signed-off-by: raver119 <raver119@gmail.com> * OpaqueLaunchContext++ Signed-off-by: raver119 <raver119@gmail.com> * more of OpaqueLaunchContext methods Signed-off-by: raver119 <raver119@gmail.com> * LaunchContext -> CudaContext Signed-off-by: raver119 <raver119@gmail.com> * AffinityManger changes Signed-off-by: raver119 <raver119@gmail.com> * AffinityManger changes Signed-off-by: raver119 <raver119@gmail.com> * cusolver handles Signed-off-by: raver119 <raver119@gmail.com> * typo Signed-off-by: raver119 <raver119@gmail.com> * cusolver method Signed-off-by: raver119 <raver119@gmail.com> * cusolver handle propagated Signed-off-by: raver119 <raver119@gmail.com> * blas/solver handles Signed-off-by: raver119 <raver119@gmail.com> * one more test Signed-off-by: raver119 <raver119@gmail.com> * legacy concat implementations replaced with new CustomOp Signed-off-by: raver119 <raver119@gmail.com> * one more test Signed-off-by: raver119 <raver119@gmail.com> * concat now uses way more blocks Signed-off-by: raver119 <raver119@gmail.com> * print Signed-off-by: raver119 <raver119@gmail.com> * no more triple template mmul Signed-off-by: raver119 <raver119@gmail.com> * bunch of kernels have dtypes reconsidered Signed-off-by: raver119 <raver119@gmail.com> * bunch of kernels have dtypes reconsidered Signed-off-by: raver119 <raver119@gmail.com> * bitonic sort reorganized Signed-off-by: raver119 <raver119@gmail.com> * bunch of cpu stuff removed from cuda scope Signed-off-by: raver119 <raver119@gmail.com> * bunch of cpu stuff removed from cuda scope Signed-off-by: raver119 <raver119@gmail.com> * type conversions moved to generic impl Signed-off-by: raver119 <raver119@gmail.com> * cpu data types pass Signed-off-by: raver119 <raver119@gmail.com> * non_max_suppression Signed-off-by: raver119 <raver119@gmail.com> * sortByValue fix Signed-off-by: raver119 <raver119@gmail.com> * ignore all mixed datatype tests for mmul Signed-off-by: raver119 <raver119@gmail.com> * special handling of OpProfiler exceptions Signed-off-by: raver119 <raver119@gmail.com> * - one failing concat test in cpp - Nd4j.tile now uses op internally Signed-off-by: raver119 <raver119@gmail.com> * get back dtype exception for legacy arrays deserialization Signed-off-by: raver119 <raver119@gmail.com>
2019-08-14 15:52:34 +02:00
}
#endif