@Name(value="tensorflow::TensorShapeBase<tensorflow::TensorShape>") @NoOffset @Properties(inherit=tensorflow.class) public class TensorShapeBase extends TensorShapeRep
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
Constructor and Description |
---|
TensorShapeBase()
Construct an empty TensorShape, or an unknown rank PartialTensorShape
|
TensorShapeBase(long... dim_sizes) |
TensorShapeBase(long size)
Native array allocator.
|
TensorShapeBase(LongBuffer dim_sizes) |
TensorShapeBase(LongPointer dim_sizes)
\brief Construct a
TensorShapeBase from the provided sizes. |
TensorShapeBase(Pointer p)
Pointer cast constructor.
|
TensorShapeBase(TensorShapeProto proto) |
Modifier and Type | Method and Description |
---|---|
void |
AddDim(long size)
\brief Add a dimension to the end ("inner-most").
|
void |
AppendShape(TensorShapeBase shape)
Appends all the dimensions from
shape . |
void |
AsProto(TensorShapeProto proto)
Fill
*proto from *this . |
TensorShapeIter |
begin()
For iterating through the dimensions.
|
long |
dim_size(int d)
\brief Returns the number of elements in dimension
d . |
LongVector |
dim_sizes()
Returns sizes of all dimensions.
|
int |
dims()
Return the number of dimensions in the tensor.
|
TensorShapeIter |
end() |
TensorShapeBase |
getPointer(long i) |
void |
InsertDim(int d,
long size)
\brief Insert a dimension somewhere in the
TensorShape . |
boolean |
IsFullyDefined()
Return true iff the rank and all of the dimensions are well defined
|
static boolean |
IsValid(TensorShapeProto proto)
Returns
true iff proto is a valid tensor shape. |
static Status |
IsValidShape(TensorShapeProto proto)
Returns
OK iff proto is a valid tensor shape, and a descriptive error
status otherwise. |
TensorShapeBase |
position(long position) |
void |
RemoveDim(int d)
\brief Removes dimension
d from the TensorShape . |
void |
RemoveDimRange(int begin,
int end)
\brief Removes the dimensions in range
[begin:end) from TensorShape . |
void |
RemoveLastDims(int n)
\brief Removes last
n dimensions from the TensorShape . |
void |
set_dim(int d,
long size)
\brief Modifies the size of the dimension
d to be size
REQUIRES: 0 <= d < dims()
REQUIRES: size >= 0 |
boolean |
unknown_rank()
Return whether the rank is unknown
|
Clear, DebugString, DebugString, DumpRep, MaxDimensions, num_elements, put
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, getDirectBufferAddress, getPointer, getPointer, getPointer, hashCode, interruptDeallocatorThread, isNull, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetAddress, offsetof, offsetof, parseBytes, physicalBytes, physicalBytesInaccurate, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, sizeof, toString, totalBytes, totalCount, totalPhysicalBytes, withDeallocator, zero
public TensorShapeBase(Pointer p)
Pointer(Pointer)
.public TensorShapeBase(long size)
Pointer.position(long)
.public TensorShapeBase(@Cast(value="tensorflow::int64*") @tensorflow.ArraySlice LongPointer dim_sizes)
TensorShapeBase
from the provided sizes.
REQUIRES: dim_sizes[i] >= 0
(or >= -1 for PartialTensorShape)public TensorShapeBase(@Cast(value="tensorflow::int64*") @tensorflow.ArraySlice LongBuffer dim_sizes)
public TensorShapeBase(@Cast(value="tensorflow::int64*") @tensorflow.ArraySlice long... dim_sizes)
public TensorShapeBase()
public TensorShapeBase(@Const @ByRef TensorShapeProto proto)
public TensorShapeBase position(long position)
public TensorShapeBase getPointer(long i)
getPointer
in class Pointer
@Cast(value="bool") public static boolean IsValid(@Const @ByRef TensorShapeProto proto)
true
iff proto
is a valid tensor shape.@ByVal public static Status IsValidShape(@Const @ByRef TensorShapeProto proto)
OK
iff proto
is a valid tensor shape, and a descriptive error
status otherwise.public void AddDim(@Cast(value="tensorflow::int64") long size)
size >= 0
public void AppendShape(@Const @ByRef TensorShapeBase shape)
shape
.public void InsertDim(int d, @Cast(value="tensorflow::int64") long size)
TensorShape
.
REQUIRES: 0 <= d <= dims()
REQUIRES: size >= 0
public void set_dim(int d, @Cast(value="tensorflow::int64") long size)
d
to be size
REQUIRES: 0 <= d < dims()
REQUIRES: size >= 0
public void RemoveDim(int d)
d
from the TensorShape
.
REQUIRES: 0 <= d < dims()
public void RemoveLastDims(int n)
n
dimensions from the TensorShape
.
REQUIRES: 0 <= n <= dims()
public void RemoveDimRange(int begin, int end)
[begin:end)
from TensorShape
.
Negative values of end
are interpreted as dims() + end + 1
(as in
Python). The same is true for negative values of begin
. REQUIRES:
-(dims()+1) <= begin <= dims()
REQUIRES: -(dims()+1) <= end <= dims()
public int dims()
@Cast(value="tensorflow::int64") public long dim_size(int d)
d
.
REQUIRES: 0 <= d < dims()
@ByVal public LongVector dim_sizes()
@Cast(value="bool") public boolean IsFullyDefined()
public void AsProto(TensorShapeProto proto)
*proto
from *this
.@ByVal public TensorShapeIter begin()
@ByVal public TensorShapeIter end()
Copyright © 2022. All rights reserved.