Uyarı: Bu API kullanımdan kaldırılmıştır ve değiştirme kararlı hale geldikten sonra TensorFlow'un gelecekteki bir sürümünde kaldırılacaktır.
Shape
Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
Bir işlemle üretilen tensörün muhtemelen kısmen bilinen şekli.
Genel Yöntemler
boolean | |
int | |
Statik Şekil | make (long FirstDimensionSize, long... otherDimensionSizes) N boyutlu bir değeri temsil eden bir Şekil oluşturun. |
int | |
Statik Şekil | skaler () Skaler bir değeri temsil eden bir Şekil oluşturun. |
uzun | boyut (int i) İ'inci boyutun boyutu. |
Sicim | toString () Hata ayıklama amaçlı şeklin kısa açıklaması. |
Statik Şekil | bilinmiyor () Bilinmeyen sayıda boyutu temsil eden bir Şekil oluşturun. |
Kalıtsal Yöntemler
Java.lang.Object sınıfından boolean | eşittir (Nesne arg0) |
son Sınıf<?> | getClass () |
int | hashKodu () |
son boşluk | bildir () |
son boşluk | tümünü bildir () |
Sicim | toString () |
son boşluk | bekle (uzun arg0, int arg1) |
son boşluk | bekle (uzun arg0) |
son boşluk | Beklemek () |
Genel Yöntemler
genel boole eşittir (Object obj)
public static Shape make (long FirstDimensionSize, long... otherDimensionSizes)
N boyutlu bir değeri temsil eden bir Şekil oluşturun.
Her boyut için sağlanan boyutla, N boyutlu bir değeri (N en az 1 olmak üzere) temsil eden bir Şekil oluşturur. A -1, karşılık gelen boyutun boyutunun bilinmediğini gösterir. Örneğin:
// A 2-element vector.
Shape vector = Shape.create(2);
// A 2x3 matrix.
Shape matrix = Shape.create(2, 3);
// A matrix with 4 columns but an unknown number of rows.
// This is typically used to indicate the shape of tensors that represent
// a variable-sized batch of values. The Shape below might represent a
// variable-sized batch of 4-element vectors.
Shape batch = Shape.create(-1, 4);
Parametreler
ilk Boyut Boyutu | |
---|
diğerBoyutBoyutları | |
---|
public int numDimensions ()
Bu şeklin temsil ettiği boyutların sayısı.
İade
- Boyut sayısı bilinmiyorsa -1, şekil bir skaleri temsil ediyorsa 0, bir vektör için 1, bir matris için 2 vb.
genel statik Şekil skaler ()
Skaler bir değeri temsil eden bir Şekil oluşturun.
genel uzun boyut (int i)
İade
- İstenilen boyutun boyutu veya bilinmiyorsa -1.
public String toString ()
Hata ayıklama amaçlı şeklin kısa açıklaması.
genel statik Şekil bilinmiyor ()
Bilinmeyen sayıda boyutu temsil eden bir Şekil oluşturun.
Aksi belirtilmediği sürece bu sayfanın içeriği Creative Commons Atıf 4.0 Lisansı altında ve kod örnekleri Apache 2.0 Lisansı altında lisanslanmıştır. Ayrıntılı bilgi için Google Developers Site Politikaları'na göz atın. Java, Oracle ve/veya satış ortaklarının tescilli ticari markasıdır.
Son güncelleme tarihi: 2025-07-26 UTC.
[null,null,["Son güncelleme tarihi: 2025-07-26 UTC."],[],[],null,["# Shape\n\npublic final class **Shape** \nThe possibly partially known shape of a tensor produced by an operation. \n\n### Public Methods\n\n|-----------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| boolean | [equals](/api_docs/java/org/tensorflow/Shape#equals(java.lang.Object))(Object obj) |\n| int | [hashCode](/api_docs/java/org/tensorflow/Shape#hashCode())() |\n| static [Shape](/api_docs/java/org/tensorflow/Shape) | [make](/api_docs/java/org/tensorflow/Shape#make(long,%20long...))(long firstDimensionSize, long... otherDimensionSizes) Create a Shape representing an N-dimensional value. |\n| int | [numDimensions](/api_docs/java/org/tensorflow/Shape#numDimensions())() Number of dimensions represented by this shape. |\n| static [Shape](/api_docs/java/org/tensorflow/Shape) | [scalar](/api_docs/java/org/tensorflow/Shape#scalar())() Create a Shape representing a scalar value. |\n| long | [size](/api_docs/java/org/tensorflow/Shape#size(int))(int i) The size of the i-th dimension. |\n| String | [toString](/api_docs/java/org/tensorflow/Shape#toString())() Succinct description of the shape meant for debugging. |\n| static [Shape](/api_docs/java/org/tensorflow/Shape) | [unknown](/api_docs/java/org/tensorflow/Shape#unknown())() Create a Shape representing an unknown number of dimensions. |\n\n### Inherited Methods\n\nFrom class java.lang.Object \n\n|------------------|---------------------------|\n| boolean | equals(Object arg0) |\n| final Class\\\u003c?\\\u003e | getClass() |\n| int | hashCode() |\n| final void | notify() |\n| final void | notifyAll() |\n| String | toString() |\n| final void | wait(long arg0, int arg1) |\n| final void | wait(long arg0) |\n| final void | wait() |\n\nPublic Methods\n--------------\n\n#### public boolean\n**equals**\n(Object obj)\n\n\u003cbr /\u003e\n\n##### Parameters\n\n| obj | |\n|-----|---|\n\n#### public int\n**hashCode**\n()\n\n\u003cbr /\u003e\n\n#### public static [Shape](/api_docs/java/org/tensorflow/Shape)\n**make**\n(long firstDimensionSize, long... otherDimensionSizes)\n\nCreate a Shape representing an N-dimensional value.\n\nCreates a Shape representing an N-dimensional value (N being at least 1), with the provided\nsize for each dimension. A -1 indicates that the size of the corresponding dimension is\nunknown. For example:\n\n // A 2-element vector.\n Shape vector = Shape.create(2);\n\n // A 2x3 matrix.\n Shape matrix = Shape.create(2, 3);\n\n // A matrix with 4 columns but an unknown number of rows.\n // This is typically used to indicate the shape of tensors that represent\n // a variable-sized batch of values. The Shape below might represent a\n // variable-sized batch of 4-element vectors.\n Shape batch = Shape.create(-1, 4);\n \n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n##### Parameters\n\n| firstDimensionSize | |\n| otherDimensionSizes | |\n|---------------------|---|\n\n#### public int\n**numDimensions**\n()\n\nNumber of dimensions represented by this shape. \n\n##### Returns\n\n- -1 if the number of dimensions is unknown, 0 if the shape represents a scalar, 1 for a vector, 2 for a matrix etc. \n\n#### public static [Shape](/api_docs/java/org/tensorflow/Shape)\n**scalar**\n()\n\nCreate a Shape representing a scalar value. \n\n#### public long\n**size**\n(int i)\n\nThe size of the i-th dimension. \n\n##### Parameters\n\n| i | |\n|---|---|\n\n##### Returns\n\n- The size of the requested dimension or -1 if it is unknown. \n\n#### public String\n**toString**\n()\n\nSuccinct description of the shape meant for debugging. \n\n#### public static [Shape](/api_docs/java/org/tensorflow/Shape)\n**unknown**\n()\n\nCreate a Shape representing an unknown number of dimensions."]]