Skip to content

Commit

Permalink
correct the same error
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosuc3m committed Oct 18, 2024
1 parent 7a4f2cd commit a201a6d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ private void addByteArray(byte[] arr) {
private void buildInt8(RandomAccessibleInterval<ByteType> tensor, boolean isFortranOrder, boolean isNumpy)
{
byte[] header = new byte[0];
if (isNumpy) header = getNpyHeader(tensor);
if (isNumpy) header = getNpyHeader(tensor, isFortranOrder);
long offset = 0;
for (byte b : header) {
this.pSharedMemory.setByte(offset, b);
Expand All @@ -449,7 +449,7 @@ private void buildInt8(RandomAccessibleInterval<ByteType> tensor, boolean isFort
private void buildUint8(RandomAccessibleInterval<UnsignedByteType> tensor, boolean isFortranOrder, boolean isNumpy)
{
byte[] header = new byte[0];
if (isNumpy) header = getNpyHeader(tensor);
if (isNumpy) header = getNpyHeader(tensor, isFortranOrder);
long offset = 0;
for (byte b : header) {
this.pSharedMemory.setByte(offset, b);
Expand All @@ -467,7 +467,7 @@ private void buildUint8(RandomAccessibleInterval<UnsignedByteType> tensor, boole
private void buildInt16(RandomAccessibleInterval<ShortType> tensor, boolean isFortranOrder, boolean isNumpy)
{
byte[] header = new byte[0];
if (isNumpy) header = getNpyHeader(tensor);
if (isNumpy) header = getNpyHeader(tensor, isFortranOrder);
long offset = 0;
for (byte b : header) {
this.pSharedMemory.setByte(offset, b);
Expand All @@ -486,7 +486,7 @@ private void buildInt16(RandomAccessibleInterval<ShortType> tensor, boolean isFo
private void buildUint16(RandomAccessibleInterval<UnsignedShortType> tensor, boolean isFortranOrder, boolean isNumpy)
{
byte[] header = new byte[0];
if (isNumpy) header = getNpyHeader(tensor);
if (isNumpy) header = getNpyHeader(tensor, isFortranOrder);
long offset = 0;
for (byte b : header) {
this.pSharedMemory.setByte(offset, b);
Expand All @@ -505,7 +505,7 @@ private void buildUint16(RandomAccessibleInterval<UnsignedShortType> tensor, boo
private void buildInt32(RandomAccessibleInterval<IntType> tensor, boolean isFortranOrder, boolean isNumpy)
{
byte[] header = new byte[0];
if (isNumpy) header = getNpyHeader(tensor);
if (isNumpy) header = getNpyHeader(tensor, isFortranOrder);
long offset = 0;
for (byte b : header) {
this.pSharedMemory.setByte(offset, b);
Expand All @@ -524,7 +524,7 @@ private void buildInt32(RandomAccessibleInterval<IntType> tensor, boolean isFort
private void buildUint32(RandomAccessibleInterval<UnsignedIntType> tensor, boolean isFortranOrder, boolean isNumpy)
{
byte[] header = new byte[0];
if (isNumpy) header = getNpyHeader(tensor);
if (isNumpy) header = getNpyHeader(tensor, isFortranOrder);
long offset = 0;
for (byte b : header) {
this.pSharedMemory.setByte(offset, b);
Expand All @@ -543,7 +543,7 @@ private void buildUint32(RandomAccessibleInterval<UnsignedIntType> tensor, boole
private void buildInt64(RandomAccessibleInterval<LongType> tensor, boolean isFortranOrder, boolean isNumpy)
{
byte[] header = new byte[0];
if (isNumpy) header = getNpyHeader(tensor);
if (isNumpy) header = getNpyHeader(tensor, isFortranOrder);
long offset = 0;
for (byte b : header) {
this.pSharedMemory.setByte(offset, b);
Expand All @@ -562,7 +562,7 @@ private void buildInt64(RandomAccessibleInterval<LongType> tensor, boolean isFor
private void buildFloat32(RandomAccessibleInterval<FloatType> tensor, boolean isFortranOrder, boolean isNumpy)
{
byte[] header = new byte[0];
if (isNumpy) header = getNpyHeader(tensor);
if (isNumpy) header = getNpyHeader(tensor, isFortranOrder);
long offset = 0;
for (byte b : header) {
this.pSharedMemory.setByte(offset, b);
Expand All @@ -581,7 +581,7 @@ private void buildFloat32(RandomAccessibleInterval<FloatType> tensor, boolean is
private void buildFloat64(RandomAccessibleInterval<DoubleType> tensor, boolean isFortranOrder, boolean isNumpy)
{
byte[] header = new byte[0];
if (isNumpy) header = getNpyHeader(tensor);
if (isNumpy) header = getNpyHeader(tensor, isFortranOrder);
long offset = 0;
for (byte b : header) {
this.pSharedMemory.setByte(offset, b);
Expand All @@ -598,10 +598,10 @@ private void buildFloat64(RandomAccessibleInterval<DoubleType> tensor, boolean i
}

private static <T extends RealType<T> & NativeType<T>>
byte[] getNpyHeader(RandomAccessibleInterval<T> tensor) {
byte[] getNpyHeader(RandomAccessibleInterval<T> tensor, boolean isFortran) {
String strHeader = "{'descr': '<";
strHeader += DecodeNumpy.getDataType(tensor.getAt(tensor.minAsLongArray()));
strHeader += "', 'fortran_order': False, 'shape': (";
strHeader += "', 'fortran_order': " + (isFortran ? "True" : "False") + ", 'shape': (";
for (long ll : tensor.dimensionsAsLongArray()) strHeader += ll + ", ";
strHeader = strHeader.substring(0, strHeader.length() - 2);
strHeader += "), }" + System.lineSeparator();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -487,10 +487,10 @@ private void addByteArray(byte[] arr) {
}

private static <T extends RealType<T> & NativeType<T>>
byte[] getNpyHeader(RandomAccessibleInterval<T> tensor) {
byte[] getNpyHeader(RandomAccessibleInterval<T> tensor, boolean isFortran) {
String strHeader = "{'descr': '<";
strHeader += DecodeNumpy.getDataType(tensor.getAt(tensor.minAsLongArray()));
strHeader += "', 'fortran_order': False, 'shape': (";
strHeader += "', 'fortran_order': " + (isFortran ? "True" : "False") + ", 'shape': (";
for (long ll : tensor.dimensionsAsLongArray()) strHeader += ll + ", ";
strHeader = strHeader.substring(0, strHeader.length() - 2);
strHeader += "), }" + System.lineSeparator();
Expand All @@ -517,7 +517,7 @@ byte[] getNpyHeader(RandomAccessibleInterval<T> tensor) {
private void buildInt8(RandomAccessibleInterval<ByteType> tensor, boolean isFortranOrder, boolean isNumpy)
{
byte[] header = new byte[0];
if (isNumpy) header = getNpyHeader(tensor);
if (isNumpy) header = getNpyHeader(tensor, isFortranOrder);
long offset = 0;
for (byte b : header) {
this.mappedPointer.setByte(offset, b);
Expand All @@ -535,7 +535,7 @@ private void buildInt8(RandomAccessibleInterval<ByteType> tensor, boolean isFort
private void buildUint8(RandomAccessibleInterval<UnsignedByteType> tensor, boolean isFortranOrder, boolean isNumpy)
{
byte[] header = new byte[0];
if (isNumpy) header = getNpyHeader(tensor);
if (isNumpy) header = getNpyHeader(tensor, isFortranOrder);
long offset = 0;
for (byte b : header) {
this.mappedPointer.setByte(offset, b);
Expand All @@ -553,7 +553,7 @@ private void buildUint8(RandomAccessibleInterval<UnsignedByteType> tensor, boole
private void buildInt16(RandomAccessibleInterval<ShortType> tensor, boolean isFortranOrder, boolean isNumpy)
{
byte[] header = new byte[0];
if (isNumpy) header = getNpyHeader(tensor);
if (isNumpy) header = getNpyHeader(tensor, isFortranOrder);
long offset = 0;
for (byte b : header) {
this.mappedPointer.setByte(offset, b);
Expand All @@ -572,7 +572,7 @@ private void buildInt16(RandomAccessibleInterval<ShortType> tensor, boolean isFo
private void buildUint16(RandomAccessibleInterval<UnsignedShortType> tensor, boolean isFortranOrder, boolean isNumpy)
{
byte[] header = new byte[0];
if (isNumpy) header = getNpyHeader(tensor);
if (isNumpy) header = getNpyHeader(tensor, isFortranOrder);
long offset = 0;
for (byte b : header) {
this.mappedPointer.setByte(offset, b);
Expand All @@ -591,7 +591,7 @@ private void buildUint16(RandomAccessibleInterval<UnsignedShortType> tensor, boo
private void buildInt32(RandomAccessibleInterval<IntType> tensor, boolean isFortranOrder, boolean isNumpy)
{
byte[] header = new byte[0];
if (isNumpy) header = getNpyHeader(tensor);
if (isNumpy) header = getNpyHeader(tensor, isFortranOrder);
long offset = 0;
for (byte b : header) {
this.mappedPointer.setByte(offset, b);
Expand All @@ -610,7 +610,7 @@ private void buildInt32(RandomAccessibleInterval<IntType> tensor, boolean isFort
private void buildUint32(RandomAccessibleInterval<UnsignedIntType> tensor, boolean isFortranOrder, boolean isNumpy)
{
byte[] header = new byte[0];
if (isNumpy) header = getNpyHeader(tensor);
if (isNumpy) header = getNpyHeader(tensor, isFortranOrder);
long offset = 0;
for (byte b : header) {
this.mappedPointer.setByte(offset, b);
Expand All @@ -629,7 +629,7 @@ private void buildUint32(RandomAccessibleInterval<UnsignedIntType> tensor, boole
private void buildInt64(RandomAccessibleInterval<LongType> tensor, boolean isFortranOrder, boolean isNumpy)
{
byte[] header = new byte[0];
if (isNumpy) header = getNpyHeader(tensor);
if (isNumpy) header = getNpyHeader(tensor, isFortranOrder);
long offset = 0;
for (byte b : header) {
this.mappedPointer.setByte(offset, b);
Expand All @@ -648,7 +648,7 @@ private void buildInt64(RandomAccessibleInterval<LongType> tensor, boolean isFor
private void buildFloat32(RandomAccessibleInterval<FloatType> tensor, boolean isFortranOrder, boolean isNumpy)
{
byte[] header = new byte[0];
if (isNumpy) header = getNpyHeader(tensor);
if (isNumpy) header = getNpyHeader(tensor, isFortranOrder);
long offset = 0;
for (byte b : header) {
this.mappedPointer.setByte(offset, b);
Expand All @@ -667,7 +667,7 @@ private void buildFloat32(RandomAccessibleInterval<FloatType> tensor, boolean is
private void buildFloat64(RandomAccessibleInterval<DoubleType> tensor, boolean isFortranOrder, boolean isNumpy)
{
byte[] header = new byte[0];
if (isNumpy) header = getNpyHeader(tensor);
if (isNumpy) header = getNpyHeader(tensor, isFortranOrder);
long offset = 0;
for (byte b : header) {
this.mappedPointer.setByte(offset, b);
Expand Down

0 comments on commit a201a6d

Please sign in to comment.