Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 49 for new_shape (0.15 sec)

  1. tensorflow/compiler/mlir/quantization/tensorflow/passes/prepare_lifting.cc

      auto shape = mlir::cast<ShapedType>(value.getType());
      if (shape.getRank() != 1) {
        SmallVector<int64_t> new_shape;
        new_shape.push_back(shape.getNumElements());
        value = builder.create<TF::ReshapeOp>(
            loc, value, Create1DConstValue(builder, loc, new_shape));
      }
      return ConstantFoldOpIfPossible(value.getDefiningOp()).front();
    }
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri May 17 17:58:54 UTC 2024
    - 13.3K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/tensorflow/ir/tf_ops_layout_helper.cc

        ArrayRef<int64_t> shape = ranked_type.getShape();
        assert(permutation.size() == shape.size());
    
        SmallVector<int64_t, 4> new_shape(permutation.size());
        for (size_t i = 0; i < permutation.size(); ++i)
          new_shape[i] = shape[permutation[i]];
    
        return RankedTensorType::get(new_shape, ranked_type.getElementType());
      }
    
      return type;
    }
    
    bool AreCancellablePermutations(DenseIntElementsAttr perm0,
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 3.3K bytes
    - Viewed (0)
  3. tensorflow/compiler/mlir/lite/experimental/tac/transforms/device_transform_patterns.cc

        // Get the new shape.
        SmallVector<int64_t, 4> new_shape;
        for (int i = 0; i < 4 - rank; ++i) {
          new_shape.push_back(1);
        }
        for (auto size : input_type.getShape()) {
          new_shape.push_back(size);
        }
    
        auto reshape_op =
            InsertReshapeOp(concat_op.getLoc(), input, input_type.getElementType(),
                            new_shape, &rewriter);
        reshape_ops.push_back(reshape_op.getResult());
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 25.4K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/quantization/tensorflow/passes/convert_tf_xla_op_to_tf_op.cc

              slice_sizes));
    
      // Collapses dimensions by reshaping.
      SmallVector<int64_t> new_shape(operand_rank - collapsed_dims.size());
      for (int64_t i = 0, j = 0; i < operand_rank; i++) {
        if (!collapsed_dims.contains(i)) {
          new_shape[j++] = operand_shape[i];
        }
      }
      if (!new_shape.empty()) new_shape[0] = -1;
      return builder.create<TF::ReshapeOp>(
          loc, output.getType(), slice_op,
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 13.2K bytes
    - Viewed (0)
  5. tensorflow/compiler/mlir/tensorflow/transforms/tpu_space_to_depth_pass.cc

    TF::ReshapeOp GetReshapeOpForConv2DFilter(ArrayRef<int64_t> new_shape,
                                              Value input, OpBuilder* builder) {
      auto reshape_result_type =
          RankedTensorType::get(new_shape, getElementTypeOrSelf(input));
      auto reshape_type = RankedTensorType::get(
          {static_cast<int64_t>(new_shape.size())}, builder->getIntegerType(64));
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 29.3K bytes
    - Viewed (0)
  6. tensorflow/compiler/mlir/tensorflow/transforms/set_tpu_infeed_layout.cc

      XLA_Shape old_shape_c = {};
      XLA_Shape new_shape_c = {};
      TfTpu_ExecutorApiFn *executor = stream_executor::tpu::ExecutorApiFn();
      if (!stream_executor::tpu::IsInitialized(executor)) {
        return failure();
      }
      ApiConverter::ToC(old_shape, &old_shape_c);
      executor->TpuTransferManager_GetInfeedLayoutFn(&old_shape_c, &new_shape_c);
      xla::Shape new_shape = ApiConverter::FromC(&new_shape_c);
      ApiConverter::Destroy(&old_shape_c);
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 6.1K bytes
    - Viewed (0)
  7. tensorflow/compiler/mlir/lite/tests/flatbuffer2mlir/legacy_reshape.json

          "outputs": [1],
          "operators": [
            {
              "inputs": [ 0 ],
              "outputs": [ 1 ],
              "builtin_options_type": "ReshapeOptions",
              "builtin_options": {
                "new_shape": [ 2, 2 ]
              }
            }
          ]
        }
      ],
      "buffers": []
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu May 02 09:41:17 UTC 2024
    - 986 bytes
    - Viewed (0)
  8. tensorflow/compiler/mlir/quantization/tensorflow/passes/preprocess_op.cc

        TensorType new_shape = RankedTensorType::get(
            {cur_shape[0], cur_shape[1], 1, cur_shape[2] * cur_shape[3]},
            attr.getElementType());
    
        // Inserts a reshape op.
        auto shape_spec_type =
            RankedTensorType::get({cur_rank}, rewriter.getIntegerType(64));
        auto new_shape_const_attr =
            DenseElementsAttr::get(shape_spec_type, new_shape.getShape());
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 11.4K bytes
    - Viewed (0)
  9. tensorflow/compiler/mlir/lite/utils/utils.h

      }
      int rank = shaped_type.getRank();
      if (rank < 2) {
        return nullptr;
      }
      SmallVector<int64_t> new_shape(shaped_type.getShape().begin(),
                                     shaped_type.getShape().end());
      std::swap(new_shape[rank - 1], new_shape[rank - 2]);
      return shaped_type.clone(new_shape);
    }
    
    // Returns a ShapedType for a permutation and the shape of input after
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Apr 30 00:40:15 UTC 2024
    - 11.6K bytes
    - Viewed (0)
  10. tensorflow/c/ops_test.cc

      ASSERT_EQ(TF_OK, TF_GetCode(status));
      TF_ShapeHandle* new_shape = TF_ShapeInferenceContextVectorFromSize(
          ctx, TF_ShapeInferenceContextRank(ctx, handle));
      TF_ShapeInferenceContextSetOutput(ctx, 0, new_shape, status);
      TF_DeleteShapeHandle(handle);
      TF_DeleteShapeHandle(new_shape);
    }
    
    TEST(OpsTest, TestShapeInference_VectorizeFunction) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed Aug 11 01:20:50 UTC 2021
    - 12.6K bytes
    - Viewed (0)
Back to top