Skip to content

Conversation

@ShuhanYan
Copy link

No description provided.

* should be equal to the dimension number of the tensor.
* Tensor should not be empty.
*
* @param d1,( d2, d3, d4, d5) the given position
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

d1,( d2, d3, d4, d5) or d1 d2, d3, d4, d5 ?

def view(sizes: Array[Int]): Tensor[T]

/**
* Returns a tensor which contains all slices of size size
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why there are two 'size' words?

implicit ev: TensorNumeric[T]): Tensor[T] = new DenseTensor[T](d1, d2, d3, d4, d5)

/**
* Create a tensor on an given dimensions. The tensor size will be the product of dims
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on given dimensions (remove an)

DenseTensor.size2Stride(dims.toArray), dims.length)

/**
* Create a tensor on an given sizes. The tensor size will be the product of sizes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on given sizes (remove an)

}

/**
* create a tensor with an given tensor. The tensor will have same size
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a given tensor

}

/**
* create a tensor with an given tensor. The tensor will have same size
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have the same size

implicit ev: TensorNumeric[T]): Tensor[T] = new DenseTensor(other)

/**
* create a tensor with an given breeze vector. The tensor will have same size
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a given, the same size

if (matrix.isTranspose) Array(1, matrix.majorStride) else Array(matrix.majorStride, 1))

/**
* create a tensor with an given spark Densematrix. The tensor will have same size with
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a given, the same size

apply[Double](Storage(vector.toArray))

/**
* create a tensor with an given breeze matrix. The tensor will have same size with
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a given, the same size

vector.offset + 1, Array(vector.length), Array(vector.stride))

/**
* create a tensor with an given spark Densevector. The tensor will have same size
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a given, the same size

package com.intel.analytics.sparkdl.tensor

/**
* It provides multiple math operation function for manipulating Tensor objects.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

functions

/**
* It provides multiple math operation function for manipulating Tensor objects.
* All functions support both allocating a new Tensor to return the result
* and treating the caller as the target Tensor, in which case the target Tensor(s)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as a target Tensor

* It provides multiple math operation function for manipulating Tensor objects.
* All functions support both allocating a new Tensor to return the result
* and treating the caller as the target Tensor, in which case the target Tensor(s)
* will be resized accordingly and filled with result. This property is especially
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with the result

* All functions support both allocating a new Tensor to return the result
* and treating the caller as the target Tensor, in which case the target Tensor(s)
* will be resized accordingly and filled with result. This property is especially
* useful when one wants have tight control over when memory is allocated.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wants to have

}

/**
* subtract all elements of this with value not in place.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with the value @param s

@ShuhanYan ShuhanYan changed the title add commits of Tensor and Tensormath add comments of Tensor and Tensormath Oct 10, 2016
@ShuhanYan ShuhanYan closed this Oct 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants