Conozca lo último en aprendizaje automático, IA generativa y más en el
Simposio WiML 2023.
Shape
Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
La forma posiblemente parcialmente conocida de un tensor producido por una operación.
Métodos públicos
booleano | |
En t | |
estática Forma | hacer (firstDimensionSize larga, larga ... otherDimensionSizes) Cree una forma que represente un valor N-dimensional. |
En t | numDimensions () Número de dimensiones representadas por esta forma. |
estática Forma | escalar () Cree una forma que represente un valor escalar. |
largo | tamaño (int i) El tamaño de la i-ésima dimensión. |
Cuerda | toString () Descripción sucinta de la forma destinada a la depuración. |
estática Forma | desconocido () Cree una forma que represente un número desconocido de dimensiones. |
Métodos heredados
De la clase java.lang.Object booleano | equals (Object arg0) |
Clase final <?> | getClass () |
En t | hashCode () |
vacío final | notificar () |
vacío final | notifyAll () |
Cuerda | toString () |
vacío final | espera (tiempo arg0, arg1 int) |
vacío final | espera (arg0 largo) |
vacío final | wait () |
Métodos públicos
public boolean equals (Object obj)
public static Forma maquillaje (firstDimensionSize larga, larga ... otherDimensionSizes)
Cree una forma que represente un valor N-dimensional.
Crea una forma que representa un valor N-dimensional (N es al menos 1), con el tamaño proporcionado para cada dimensión. Un -1 indica que se desconoce el tamaño de la dimensión correspondiente. Por ejemplo:
// 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);
numDimensions public int ()
Número de dimensiones representadas por esta forma.
Devoluciones
- -1 si se desconoce el número de dimensiones, 0 si la forma representa un escalar, 1 para un vector, 2 para una matriz, etc.
public static Forma escalar ()
Cree una forma que represente un valor escalar.
tamaño pública de largo (int i)
El tamaño de la i-ésima dimensión.
Devoluciones
- El tamaño de la dimensión solicitada o -1 si se desconoce.
Cadena public toString ()
Descripción sucinta de la forma destinada a la depuración.
public static Forma desconocido ()
Cree una forma que represente un número desconocido de dimensiones.
Salvo que se indique lo contrario, el contenido de esta página está sujeto a la licencia Atribución 4.0 de Creative Commons, y los ejemplos de código están sujetos a la licencia Apache 2.0. Para obtener más información, consulta las políticas del sitio de Google Developers. Java es una marca registrada de Oracle o sus afiliados. Cierto contenido está sujeto a la licencia de NumPy.
Última actualización: 2021-08-16 (UTC)
[null,null,["Última actualización: 2021-08-16 (UTC)"],[],[],null,["# Shape\n\npublic final class **Shape** \n\nThe possibly partially known shape of a tensor produced by an operation. \n\n### Public Methods\n\n|-------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| boolean | [equals](/versions/r2.6/api_docs/java/org/tensorflow/Shape#equals(java.lang.Object)) (Object obj) |\n| int | [hashCode](/versions/r2.6/api_docs/java/org/tensorflow/Shape#hashCode()) () |\n| static [Shape](/versions/r2.6/api_docs/java/org/tensorflow/Shape) | [make](/versions/r2.6/api_docs/java/org/tensorflow/Shape#make(long, long...)) (long firstDimensionSize, long... otherDimensionSizes) Create a Shape representing an N-dimensional value. |\n| int | [numDimensions](/versions/r2.6/api_docs/java/org/tensorflow/Shape#numDimensions()) () Number of dimensions represented by this shape. |\n| static [Shape](/versions/r2.6/api_docs/java/org/tensorflow/Shape) | [scalar](/versions/r2.6/api_docs/java/org/tensorflow/Shape#scalar()) () Create a Shape representing a scalar value. |\n| long | [size](/versions/r2.6/api_docs/java/org/tensorflow/Shape#size(int)) (int i) The size of the i-th dimension. |\n| String | [toString](/versions/r2.6/api_docs/java/org/tensorflow/Shape#toString()) () Succinct description of the shape meant for debugging. |\n| static [Shape](/versions/r2.6/api_docs/java/org/tensorflow/Shape) | [unknown](/versions/r2.6/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\n#### public boolean\n**equals**\n(Object obj)\n\n\n#### public int\n**hashCode**\n()\n\n\n#### public static [Shape](/versions/r2.6/api_docs/java/org/tensorflow/Shape)\n**make**\n(long firstDimensionSize, long... otherDimensionSizes)\n\n\nCreate a Shape representing an N-dimensional value.\n\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\n#### public int\n**numDimensions**\n()\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](/versions/r2.6/api_docs/java/org/tensorflow/Shape)\n**scalar**\n()\n\n\nCreate a Shape representing a scalar value.\n\n#### public long\n**size**\n(int i)\n\n\nThe size of the i-th dimension. \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\n\nSuccinct description of the shape meant for debugging.\n\n#### public static [Shape](/versions/r2.6/api_docs/java/org/tensorflow/Shape)\n**unknown**\n()\n\n\nCreate a Shape representing an unknown number of dimensions."]]