Package com.yahoo.tensor
Class PartialAddress
- java.lang.Object
-
- com.yahoo.tensor.PartialAddress
-
public class PartialAddress extends java.lang.Object
An address to a subset of a tensors' cells, specifying a label for some but not necessarily all of the tensors dimensions.- Author:
- bratseth
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PartialAddress.Builder
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TensorAddress
asAddress(TensorType type)
Returns this as an address in the given tensor typejava.lang.String
dimension(int i)
java.lang.String
label(int i)
Returns the label at position ijava.lang.String
label(java.lang.String dimensionName)
Returns the label of this dimension, or null if no label is specified for itlong
numericLabel(java.lang.String dimensionName)
Returns the numeric label of this dimension, or -1 if no label is specified for itint
size()
java.lang.String
toString()
-
-
-
Method Detail
-
dimension
public java.lang.String dimension(int i)
-
numericLabel
public long numericLabel(java.lang.String dimensionName)
Returns the numeric label of this dimension, or -1 if no label is specified for it
-
label
public java.lang.String label(java.lang.String dimensionName)
Returns the label of this dimension, or null if no label is specified for it
-
label
public java.lang.String label(int i)
Returns the label at position i- Throws:
java.lang.IllegalArgumentException
- if i is out of bounds
-
size
public int size()
-
asAddress
public TensorAddress asAddress(TensorType type)
Returns this as an address in the given tensor type
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-