Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ndarray

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ndarray - npm Package Compare versions

Comparing version 0.2.2 to 0.2.3

34

index.js

@@ -85,7 +85,7 @@ "use strict"

function zeros(shape, dtype, order) {
if(typeof(dtype) === "undefined") {
if(!dtype) {
dtype = "float64"
}
//Default row-major order
if(typeof(order) === "undefined") {
if(!order) {
order = new Array(shape.length)

@@ -96,3 +96,3 @@ for(var i=shape.length-1, j=0; i>=0; --i, ++j) {

}
var stride = new Array(shape.length)
var stride = new Array(shape.length)
var size = 1

@@ -153,7 +153,25 @@ for(var i=0; i<shape.length; ++i) {

function pstride(shape, order) {
var i = 0, d = shape.length
var result = new Array(d), s = 1
if(order) {
for(i=0; i<d; ++i) {
result[order[i]] = s
s *= shape[order[i]]
}
} else {
for(var i=d-1; i>=0; --i) {
stride[i] = s
s *= shape[i]
}
}
return result
}
module.exports = wrap
module.exports.zeros = zeros
module.exports.dtype = dtype
module.exports.order = order
module.exports.size = size
module.exports.ctor = makeView
module.exports.zeros = zeros
module.exports.dtype = dtype
module.exports.order = order
module.exports.size = size
module.exports.stride = pstride
module.exports.ctor = makeView
{
"name": "ndarray",
"version": "0.2.2",
"version": "0.2.3",
"description": "Multidimensional Arrays",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -133,2 +133,10 @@ ndarray

### `ndarray.stride(shape[, order])`
Computes the stride for a packed ndarray with the given order. If the order is not specified row major order is assumed.
* `shape` the shape if the array
* `order` the order of the stride
**Returns** The stride of the array
Views

@@ -135,0 +143,0 @@ =====

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc