test editor_qhdxds的博客-程序员宅基地

namespace caffe {


/**
 * @brief A wrapper around SyncedMemory holders serving as the basic
 *        computational unit through which Layer%s, Net%s, and Solver%s
 *        interact.
 *
 * TODO(dox): more thorough description.
 */
template <typename Dtype>
class Blob {
 public:
  Blob()
       : data_(), diff_(), count_(0), capacity_(0) {}


  /// @brief Deprecated; use <code>Blob(const vector<int>& shape)</code>.
  explicit Blob(const int num, const int channels, const int height,
      const int width);
  explicit Blob(const vector<int>& shape);


  /// @brief Deprecated; use <code>Reshape(const vector<int>& shape)</code>.
  void Reshape(const int num, const int channels, const int height,
      const int width);
  /**
   * @brief Change the dimensions of the blob, allocating new memory if
   *        necessary.
   *
   * This function can be called both to create an initial allocation
   * of memory, and to adjust the dimensions of a top blob during Layer::Reshape
   * or Layer::Forward. When changing the size of blob, memory will only be
   * reallocated if sufficient memory does not already exist, and excess memory
   * will never be freed.
   *
   * Note that reshaping an input blob and immediately calling Net::Backward is
   * an error; either Net::Forward or Net::Reshape need to be called to
   * propagate the new input shape to higher layers.
   */
  void Reshape(const vector<int>& shape);
  void Reshape(const BlobShape& shape);
  void ReshapeLike(const Blob& other);
  inline string shape_string() const {
    ostringstream stream;
    for (int i = 0; i < shape_.size(); ++i) {
      stream << shape_[i] << " ";
    }
    stream << "(" << count_ << ")";
    return stream.str();
  }
  inline const vector<int>& shape() const { return shape_; }
  /**
   * @brief Returns the dimension of the index-th axis (or the negative index-th
   *        axis from the end, if index is negative).
   *
   * @param index the axis index, which may be negative as it will be
   *        "canonicalized" using CanonicalAxisIndex.
   *        Dies on out of range index.
   */
  inline int shape(int index) const {
    return shape_[CanonicalAxisIndex(index)];
  }
  inline int num_axes() const { return shape_.size(); }
  inline int count() const { return count_; }


  /**
   * @brief Compute the volume of a slice; i.e., the product of dimensions
   *        among a range of axes.
   *
   * @param start_axis The first axis to include in the slice.
   *
   * @param end_axis The first axis to exclude from the slice.
   */
  inline int count(int start_axis, int end_axis) const {
    CHECK_LE(start_axis, end_axis);
    CHECK_GE(start_axis, 0);
    CHECK_GE(end_axis, 0);
    CHECK_LE(start_axis, num_axes());
    CHECK_LE(end_axis, num_axes());
    int count = 1;
    for (int i = start_axis; i < end_axis; ++i) {
      count *= shape(i);
    }
    return count;
  }
版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/qhdxds/article/details/51265296

智能推荐

azure云数据库_Azure SQL数据库上的透明数据加密(TDE)_culuo4781的博客-程序员宅基地

azure云数据库 In this article, we will review on Transparent Data Encryption (TDE) on an Azure SQL database and how to enable Transparent data encryption using Asymmetric keys in Azure Key Vault...

子类继承父类方法无法aop_Spring AOP拦截抽象类(父类)中方法失效问题_glow law的博客-程序员宅基地

背景最近工作中需要对组内各个系统依赖的第三方接口进行监控报警,对于下游出现问题的接口能够及时感知.首先我们写了一个Spring AOP注解,用于收集调用第三方时返回的信息.而我们调用第三方的类抽象出一个父类.并在父类的方法中加入我们的自定义注解用于监控日志并打印日志.很多子类继承了这个父类并使用父类中的方法.如:当调用子类的doSomething方法时问题出现了,发现Spring AOP没有拦截d...

[论文学习]Learn to Dance with AIST++: Music Conditioned 3D Dance Generation_audio to motion_Queen&King的博客-程序员宅基地

论文学习:Learn to Dance with AIST++: Music Conditioned 3D Dance Generation论文主要工作核心任务:TaskAIST++数据集核心网络:Transformer-based learning frameworkDeep cross-modal transformer部分相关工作:Baseline Method3D Human Motion SynthesisCross-Modal Sequence-to-Sequence GenerationAud

Lossless Data Compression(无损数据压缩)_her0z的博客-程序员宅基地

Lossless Data CompressionContentsIntroduction Huffman Coding Lempel-Ziv Coding Notes References I. Introduction   The main objective of this page is to introduce two important lo

2.2 Go语言从入门到精通:Go语言变量_xcbeyond的博客-程序员宅基地

文章目录1、变量的声明1.1 标准声明格式1.2 根据值自行判定变量类型1.3 短变量声明1.4 批量声明2、变量的初始化3、变量的多重赋值4、匿名变量5、变量的作用域5.1 局部变量5.2 全局变量5.3 形式参数变量来源于数学,是计算机语言中能储存计算结果或能表示值的抽象概念。Go语言是静态类型语言,因此变量(variable)是有明确类型的,编译器也会检查变量类型的正确性。变量可以通过变量名访问。Go 语言变量名由字母、数字、下划线组成,其中首个字符不能为数字。1、变量的声明声明变量的一般

基于TI-RTOS的CC2640 UART_In_the_way_Wang的博客-程序员宅基地

阻塞(blocking)模式下CC2640 UART代码的编写

随便推点

centos7 和 ubuntu 安装xrdp_安装xrdp显示无法找到_xingxing12323的博客-程序员宅基地

centos7 和 ubuntu 安装xrdpcentos7安装xrdp问题1.xrdp 找不到ubuntu 的安装centos7安装xrdp#安装软件 yum install xrdp tigervnc tigervnc-server -y # 我这里按装xrdp 发现找不到#配置selinux vim /etc/selinux/config # SELINUX=disabled #配置防火墙firewall-cmd --permanent --zone=public --add-po

esp32 ADC数据采集(光敏电阻)_adc光敏电阻_JokerPlus0615的博客-程序员宅基地

1、关于光敏电阻的原理介绍等信息就不一一介绍了,先上具体原理图 硬件连接,采用的是esp32 s2 的IO34号引脚,也就是ADC1_CH6(GPIO34)2、程序源码#include &lt;stdio.h&gt;#include "esp_system.h"#include "esp_spi_flash.h"#include "esp_wifi.h"#include "esp_event_loop.h...

解决fatal error: sqlite3.h: No such file or directory_jeezx的博客-程序员宅基地

编译sqlite3数据库c语言程序时出现fatal error: sqlite3.h: No such file or directory,找不到头文件的问题。原来是系统没有安装函数库。执行下面语句解决:sudo apt-get install libsqlite3-dev【补充】:当用交叉编译器编译的时候,也会出现找不到sqlite3.h头文件的情

Tableue 实现数据分组统计 - 依据连续度量创建数据桶_tableau数据分区间统计_张驰Zhangchi的博客-程序员宅基地

版本:2020.4适用于: Tableau Desktop, Tableau Online, Tableau Server有时,将连续度量(或数值维度)转换为数据桶会很有用。Tableau 中的任何离散字段都可以被认为是一组数据桶。例如,假设您创建了一个视图,“Profit”(利润)在行上,“State”(省/市/自治区)在列上。您可以将**“State”(省/市/自治区)字段视为一组数据桶 — 每个利润值会按数据桶进行分类,该数据桶与从中记录值的省/市/自治区相对应。但是,如果想要查看分配给数据桶

Vue代理解决生产环境跨域问题 部署必备干货_别把代码当饭吃的博客-程序员宅基地

当我们前端要调用跨域接口时,我们需要用代理解决跨域问题,比如Vue的代理配置proxy,但是当Vue项目打包成静态文件时,他的代理也就失灵了,因为代理的前提是本地必须有service,本章讲一下生产环境的Vue项目如何做代理。本章我们从两方面讲解Vue解决跨域的方案,一种是本地开发环境,另一种是生产环境(nginx解决vue跨域问题)1.Vue本地(开发环境)解决跨域流程如下(1)打开...

web常用通用组件+Axure后台管理系统框架模板+大屏数据可视化元件库+智慧社区管理系统大屏+图表组件+表单组合+智慧数据看板+通用大屏图表原件库+电脑端常用组件_axure web元件库_墨兮_moxi的博客-程序员宅基地

作品介绍:web常用通用组件+Axure后台管理系统框架模板+大屏数据可视化元件库+智慧社区管理系统大屏+图表组件+表单组合+智慧数据看板+通用大屏图表原件库+电脑端常用组件原型演示及下载地址:https://www.pmdaniu.com/storage/121903/77941c499a344ba8c37cfe08dc28e147-30328/start.html#id=vvu74i&amp;p=%E4%BD%9C%E5%93%81%E4%BB%8B%E7%BB%8D&amp;g=1作品效果展.

推荐文章

热门文章

相关标签