public class MixedTensor extends Object implements Tensor
Modifier and Type | Class and Description |
---|---|
static class |
MixedTensor.BoundBuilder
Builder for mixed tensors with bound indexed dimensions.
|
static class |
MixedTensor.Builder
Base class for building mixed tensors.
|
private static class |
MixedTensor.Index
An immutable index into a list of cells.
|
static class |
MixedTensor.UnboundBuilder
Temporarily stores all cells to find bounds of indexed dimensions,
then creates a tensor using BoundBuilder.
|
Tensor.Cell
Modifier and Type | Field and Description |
---|---|
private com.google.common.collect.ImmutableList<Tensor.Cell> |
cells
The list of cells in the tensor
|
private MixedTensor.Index |
index
An index structure over the cell list
|
private TensorType |
type
The dimension specification for this tensor
|
Modifier | Constructor and Description |
---|---|
private |
MixedTensor(TensorType type,
com.google.common.collect.ImmutableList<Tensor.Cell> cells,
MixedTensor.Index index) |
Modifier and Type | Method and Description |
---|---|
Iterator<Tensor.Cell> |
cellIterator()
Returns an iterator over the cells of this tensor.
|
Map<TensorAddress,Double> |
cells()
Returns an immutable map of the cells of this in no particular order.
|
static TensorType |
createPartialType(List<TensorType.Dimension> dimensions) |
long |
denseSubspaceSize()
Returns the size of dense subspaces
|
boolean |
equals(Object other)
Returns whether this tensor and the given tensor is mathematically equal:
That they have the same dimension *names* and the same content.
|
double |
get(TensorAddress address)
Returns the value at the given address
|
int |
hashCode() |
long |
size()
Returns the size of the tensor measured in number of cells
|
String |
toString()
Returns this tensor on the form
{address1:value1,address2:value2,...}
where each address is on the form {dimension1:label1,dimension2:label2,...} ,
and values are numbers. |
TensorType |
type()
Returns the tensor type
|
Iterator<Double> |
valueIterator()
Returns an iterator over the values of this tensor.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
add, approxEqual, approxEquals, approxEquals, argmax, argmin, asDouble, atan2, avg, avg, avg, concat, concat, contentToString, count, count, count, diag, divide, equal, equals, fmod, from, from, from, generate, isEmpty, join, l1Normalize, l2Normalize, larger, largerOrEqual, ldexp, map, matmul, max, max, max, max, min, min, min, min, multiply, notEqual, pow, prod, prod, prod, random, range, reduce, reduce, rename, rename, smaller, smallerOrEqual, softmax, subtract, sum, sum, sum, toStandardString, xwPlusB
private final TensorType type
private final com.google.common.collect.ImmutableList<Tensor.Cell> cells
private final MixedTensor.Index index
private MixedTensor(TensorType type, com.google.common.collect.ImmutableList<Tensor.Cell> cells, MixedTensor.Index index)
public TensorType type()
public long size()
public double get(TensorAddress address)
public Iterator<Tensor.Cell> cellIterator()
cellIterator
in interface Tensor
public Iterator<Double> valueIterator()
valueIterator
in interface Tensor
public Map<TensorAddress,Double> cells()
Tensor
public String toString()
Tensor
{address1:value1,address2:value2,...}
where each address is on the form {dimension1:label1,dimension2:label2,...}
,
and values are numbers.
Cells are listed in the natural order of tensor addresses: Increasing size primarily and by element lexical order secondarily.
Note that while this is suggestive of JSON, it is not JSON.
public boolean equals(Object other)
Tensor
public long denseSubspaceSize()
public static TensorType createPartialType(List<TensorType.Dimension> dimensions)
Copyright © 2018. All rights reserved.