Go to the documentation of this file.
12 #include <Eigen/CXX11/Tensor>
25 template <
typename Output,
typename Device>
31 output.stride(
strides).device(device) = input;
35 output.slice(
offsets, extents).stride(
strides).device(device) = input.constant(0.0
f);
48 for (
int i = 0;
i < 6;
i+=2) {
49 for (
int j = 0;
j < 10;
j+=2) {
53 for (
int i = 1;
i < 6;
i+=2) {
54 for (
int j = 1;
j < 10;
j+=2) {
70 template <
typename Output,
typename Device>
72 Output& output,
const Device& device)
const
77 for (
int i = 0;
i < output.dimension(2); ++
i) {
78 output.template chip<2>(
i).device(device) = input1.
chip<2>(
i).contract(input2.
chip<2>(
i), dims);
92 for (
int i = 0;
i < 5; ++
i) {
98 for (
int j = 0;
j < 2; ++
j) {
99 for (
int k = 0; k < 7; ++k) {
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index dimension(std::size_t n) const
static void test_custom_binary_op()
A reference to a tensor expression The expression will be evaluated lazily (as much as possible).
EIGEN_ALWAYS_INLINE DSizes< IndexType, NumDims > strides(const DSizes< IndexType, NumDims > &dimensions)
#define VERIFY_IS_EQUAL(a, b)
static void test_custom_unary_op()
void eval(const Tensor< float, 3 > &input1, const Tensor< float, 3 > &input2, Output &output, const Device &device) const
EIGEN_DECLARE_TEST(cxx11_tensor_custom_op)
DSizes< DenseIndex, 2 > dimensions(const Tensor< float, 2 > &input) const
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE TensorChippingOp< DimId, const Tensor< Scalar_, NumIndices_, Options_, IndexType_ > > chip(const Index offset) const
DSizes< DenseIndex, 3 > dimensions(const Tensor< float, 3 > &input1, const Tensor< float, 3 > &input2) const
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
#define VERIFY_IS_APPROX(a, b)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Tensor< Scalar_, NumIndices_, Options_, IndexType_ > & setRandom()
void eval(const Tensor< float, 2 > &input, Output &output, const Device &device) const
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy y set format x g set format y g set format x2 g set format y2 g set format z g set angles radians set nogrid set key title set key left top Right noreverse box linetype linewidth samplen spacing width set nolabel set noarrow set nologscale set logscale x set offsets
Tensor< float, 1 >::DimensionPair DimPair
#define CALL_SUBTEST(FUNC)
gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:02:08