* one more CI test Signed-off-by: raver119 <raver119@gmail.com> * export additional symbols Signed-off-by: raver119 <raver119@gmail.com> * few more tweaks Signed-off-by: raver119 <raver119@gmail.com> * one more tweak for linux Signed-off-by: raver119 <raver119@gmail.com> * fix dtype in few tests Signed-off-by: raver119 <raver119@gmail.com> * missing sync and memset in couple of tests Signed-off-by: raver119 <raver119@gmail.com> * copy step for libnd4j cuda Signed-off-by: raver119 <raver119@gmail.com> * no-op on empty for adjust hue/contrast/saturation Signed-off-by: raver119 <raver119@gmail.com> * CUDA_VERBOSE Off Signed-off-by: raver119 <raver119@gmail.com> * BroadcastBool fix + few tests Signed-off-by: raver119 <raver119@gmail.com> * trigger jenkins Signed-off-by: raver119 <raver119@gmail.com> * trigger jenkins Signed-off-by: raver119 <raver119@gmail.com> * - ignore couple of warnings - remove redundant compiler options Signed-off-by: raver119 <raver119@gmail.com>
58 lines
1.8 KiB
C++
58 lines
1.8 KiB
C++
/*******************************************************************************
|
|
* Copyright (c) 2019 Konduit K.K.
|
|
*
|
|
* 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
|
|
******************************************************************************/
|
|
|
|
//
|
|
// @author raver119@gmail.com
|
|
//
|
|
|
|
#include <op_boilerplate.h>
|
|
#if NOT_EXCLUDED(OP_shapes_of)
|
|
|
|
#include <ops/declarable/CustomOperations.h>
|
|
|
|
namespace nd4j {
|
|
namespace ops {
|
|
|
|
CUSTOM_OP_IMPL(create, 1, 1, false, 0, 1) {
|
|
auto init = block.numB() > 0 ? B_ARG(0) : true;
|
|
|
|
if (init)
|
|
OUTPUT_VARIABLE(0)->nullify();
|
|
|
|
return Status::OK();
|
|
}
|
|
|
|
DECLARE_SHAPE_FN(create) {
|
|
auto shapeInput = INPUT_VARIABLE(0);
|
|
auto order = (char) INT_ARG(0);
|
|
auto dtype = DataTypeUtils::fromInt(INT_ARG(1));
|
|
|
|
REQUIRE_TRUE(order == 'c' || order == 'f', 0, "create: order must be either c or f");
|
|
|
|
auto shape = shapeInput->getBufferAsVector<Nd4jLong>();
|
|
|
|
return SHAPELIST(nd4j::ConstantShapeHelper::getInstance()->createShapeInfo(dtype, order, shape));
|
|
}
|
|
|
|
DECLARE_TYPES(create) {
|
|
getOpDescriptor()
|
|
->setAllowedInputTypes({ALL_INTS})
|
|
->setAllowedOutputTypes(nd4j::DataType::ANY);
|
|
}
|
|
}
|
|
}
|
|
|
|
#endif |