Giter Site home page Giter Site logo

cuda-practice's People

Contributors

zetwhite avatar

Stargazers

Segul Roh avatar

Watchers

 avatar

cuda-practice's Issues

EX3-5

    1. Consider a 3D tensor with a width of 400, a height of 500, and a depth of 300. The tensor is stored as a one-dimensional array in row-major order. Specify the array index of the tensor element at x = 10, y = 20, and z = 5.

Assumption

  • width corresponds to Y axis
  • height corresponds to Z axis
  • channel corresponds to X axis
			 channel(depth) 
		  / 
	    / 
	  /
  	* - - - - > width(row)
  	|
  	| 
  	|
	height(column) 
		  X  
	    / 
	  /
  	* - - - Y
  	|
	| 
	Z 

Solve

  • row-major order means that
    • the elements are continuous in row(width) direction.
    • traverse row(width) direction first, then traverse column direction next and traverse channel direction lastly
    • sometime, called CHW layout
channel_stride * (x-1) +  height_stride * (z-1) + row_stride * (y-1) 
= 400 * 500 * (10-1) + 400 * (5 - 1)  + 1 * 19 
= 1800000 + 1600 + 19 
= 1801618 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.