ONE - On-device Neural Engine
Loading...
Searching...
No Matches
morph::caffe Namespace Reference

Functions

nncc::core::ADT::tensor::Shape as_tensor_shape (const nncc::core::ADT::feature::Shape &)
 
nncc::core::ADT::tensor::Shape as_tensor_shape (const nncc::core::ADT::kernel::Shape &)
 
nncc::core::ADT::feature::Shape as_feature_shape (const nncc::core::ADT::tensor::Shape &)
 
nncc::core::ADT::kernel::Shape as_kernel_shape (const nncc::core::ADT::tensor::Shape &)
 

Function Documentation

◆ as_feature_shape()

◆ as_kernel_shape()

kernel::Shape morph::caffe::as_kernel_shape ( const nncc::core::ADT::tensor::Shape shape)

Definition at line 61 of file caffe.cpp.

62{
63 assert(shape.rank() == 4);
64 return kernel::Shape{shape.dim(0), shape.dim(1), shape.dim(2), shape.dim(3)};
65}

References nncc::core::ADT::tensor::Shape::dim(), and nncc::core::ADT::tensor::Shape::rank().

Referenced by caffeimport::ConvolutionBuilder::build().

◆ as_tensor_shape() [1/2]

tensor::Shape morph::caffe::as_tensor_shape ( const nncc::core::ADT::feature::Shape shape)

Definition at line 28 of file caffe.cpp.

29{
30 tensor::Shape res;
31
32 res.resize(4);
33 res.dim(0) = 1;
34 res.dim(1) = shape.depth();
35 res.dim(2) = shape.height();
36 res.dim(3) = shape.width();
37
38 return res;
39}
uint32_t depth(void) const
Definition Shape.h:44
uint32_t width(void) const
Definition Shape.h:46
uint32_t height(void) const
Definition Shape.h:45
Shape & resize(uint32_t size)
Definition Shape.cpp:36

References nncc::core::ADT::feature::Shape::depth(), nncc::core::ADT::tensor::Shape::dim(), nncc::core::ADT::feature::Shape::height(), nncc::core::ADT::tensor::Shape::resize(), and nncc::core::ADT::feature::Shape::width().

◆ as_tensor_shape() [2/2]

tensor::Shape morph::caffe::as_tensor_shape ( const nncc::core::ADT::kernel::Shape shape)

Definition at line 41 of file caffe.cpp.

42{
43 tensor::Shape res;
44
45 res.resize(4);
46 res.dim(0) = shape.count();
47 res.dim(1) = shape.depth();
48 res.dim(2) = shape.height();
49 res.dim(3) = shape.width();
50
51 return res;
52}
uint32_t width(void) const
Definition Shape.h:47
uint32_t height(void) const
Definition Shape.h:46
uint32_t count(void) const
Definition Shape.h:44
uint32_t depth(void) const
Definition Shape.h:45

References nncc::core::ADT::kernel::Shape::count(), nncc::core::ADT::kernel::Shape::depth(), nncc::core::ADT::tensor::Shape::dim(), nncc::core::ADT::kernel::Shape::height(), nncc::core::ADT::tensor::Shape::resize(), and nncc::core::ADT::kernel::Shape::width().